###### Descriptions and Examples for the POV-Ray Raytracerby Friedrich A. Lohmüller     Elementary Geometry for Raytracing
Italiano Français Deutsch Home
- POV-Ray Tutorial

- Geometrical Basics
for Raytracing

Right-angled Triangle
Pythagorean Theorem
Trigonometry Basics
Law of cosines
Equilateral Triangle
Regular Polygon
Polyhedron
Tetrahedron
Octahedron
Cube & Cuboid
Dodecahedron
Icosahedron
Cuboctahedron
Truncated Octahedron
Rhombicuboctahedron
Truncated Icosahedron
Circles
Tangent Circles
Internal Tangents
External Tangents

- Geometric 3D Animations

## Tangent circlesIn the following we write for the square root of a number the expression "sqrt(ZAHL)" conforming to the syntax used in POV-Ray.Note: Here objects in 2D geometry are represented by 3D shapes in the xy-plane. Therefore all coordinates must have the z-components zero! ( <?,?,0>)

 Circle 1: center M1 = <0.35,0,0>, radius r1= 0.22. Circle 2: center on y-axis, tangents Circle 1 from outside in the point S. Problem 1: Circle 2 has the radius r2 = 0.30 . Where on the y-axis (height y2) is the center of the second circle 2 ? (M2 = <0,?,0>) Problem 2: Circle 2 has the center M2 = <0,0.40,0>. How big must be the radius of a second circle 2, if it intersects (touches) the first circle 1 at the nearest point? Problem 3: What are the coordinates of the point S ? Problem 4: What are the angles at M1 and M2 inside the triangle(0,M1,M2)? The triangle(O,M1,M2) is rectangular! Therefore we use the Pythagorean Theorem: // Problem 1: //-------------------------- We know two sides of the triangle(O,M1,M2): d(0,M1) = x1 and d(M1,M2) = r1+r2.    y2 = sqrt( (r1+r2)2 - x12)    M2 = <0,y2,0>. // Problem 2: //-------------------------- Because of    r1+r2 = d(M1,M2) = sqrt(x12 + y22), we get    d(M1,M2) = sqrt( x12 - y22 )    and r2 = d(M1,M2) - r1. // Problem 3: //-------------------------- There is a simple proportionality:   xS1/xM1 = r2/ (r1+r2) and yS/yM2 = r1/ (r1+r2), so: xS = xM1 · r2/ (r1+r2)       yS = yM2 · r1/ (r1+r2). // Problem 4: //-------------------------- By the inverse trigonometric function i.e. of tan(x):    Angle(M1) = atan ( y2/ x1),    Angle(M2) = 90 - Angle(M1). Tangent circles rendered with POV-Ray
Note: To avoid any collision with built-in identifiers and reserved words in POV-Ray, it's strongly recommanded to use only words beginning with capital letters for all identifiers of variables declared by the user,
i.e. use "R1" instead of "r1" and use "Y2" instead of "yM2".
 ```#local R1= 0.22; #local R2= 0.30; #local M1 = <0.35,0,0> #local Y2 = sqrt( pow(R1+R2, 2) - pow(M1.x, 2)); #local M2 = <0,Y2,0>; ```
Problem 1 in POV-Ray
 ```#local R1= 0.22; #local M1 = <0.35,0,0> #local M2 = <0.40,0,0> #local R2 = sqrt( pow(M1.x,2)-pow(M2.y,2)) - R1;```
Problem 2 in POV-Ray
 ```#local XS = M1.x * R2/(R1+R2); #local YS = M2.y * R1/(R1+R2); #local S = #local Angle_M1 = degrees( atan( M2.y / M1.x) ); #local Angle_M2 = 90 - Angle_M1;```
Problem 3 + 4 in POV-Ray

For what can we use this geometry?
Here some examples:
We can consider the circle_1 as the cross-section of an horizontal torus and the circle_2 as the cross-section of a bowl:

We can consider the circle_1 and its twin mirrored at the y-axis as the cross-section of two cylinder in z-direction
and the circle_2 as the cross-section of another cylinder to subtract from the yellow rectangle: Round-bottom Mace for the labratory Two cylinders melting together Chain link for a bike chain
 © Friedrich A. Lohmüller, 2010 http://www.f-lohmueller.de
{"ft_lang_label":"__label__en","ft_lang_prob":0.6394649,"math_prob":0.98641086,"size":2080,"snap":"2021-04-2021-17","text_gpt3_token_len":781,"char_repetition_ratio":0.1729287,"word_repetition_ratio":0.005449591,"special_character_ratio":0.46490383,"punctuation_ratio":0.20758483,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9995939,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],"im_url_duplicate_count":[null,null,null,null,null,null,null,1,null,1,null,1,null,1,null,1,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-01-18T05:07:50Z\",\"WARC-Record-ID\":\"<urn:uuid:84bb0077-a69b-4c8f-a9b3-e0d1833ba041>\",\"Content-Length\":\"14616\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bdd6acfc-36ef-40cc-b965-98d11366bd22>\",\"WARC-Concurrent-To\":\"<urn:uuid:8e888f14-bcf9-4c2b-bcc2-9ac74489fae2>\",\"WARC-IP-Address\":\"80.150.6.143\",\"WARC-Target-URI\":\"http://www.f-lohmueller.de/pov_tut/geo/geom_c100e.htm\",\"WARC-Payload-Digest\":\"sha1:DU3H6ITX5ILDNUHPYM757DJQYRD65KWO\",\"WARC-Block-Digest\":\"sha1:FQ7AOB4Y2EDOYFTPNHYD4YI64ETQYTIZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-04/CC-MAIN-2021-04_segments_1610703514121.8_warc_CC-MAIN-20210118030549-20210118060549-00573.warc.gz\"}"}