Example Use of the Geometry Package
Description
Examples
References
To view the output from the following examples in the Standard Worksheet interface, click the Open the current help page in a worksheet window icon. Click the Execute the entire worksheet icon.
The following shows how to use the geometry package to illustrate theorems in Euclidean geometry.
Reference: Eves, Howard. A Survey of Geometry. Allyn and Bacon, 1972.
Theorem: (Feuerbach's Theorem) The nine-point circle of a triangle is tangent to the incircle and to each of the excircles of the triangle
with⁡geometry:
Define triangle ABC
triangle⁡T,point⁡A,0,0,point⁡B,3,−1,point⁡C,6,2:
Find the incircle inc of ABC
incircle⁡inc,T,'centername'=II:
Find the excircles ex1, ex2, ex3 of ABC
excircle⁡obj,T,ex1⁡I1,ex2⁡I2,ex3⁡I3:
Find the nine-point circles ec of ABC
EulerCircle⁡ec,T,'centername'=X:
Check if inc, ex1, ex2, ex3 are tangent to ec
AreTangent⁡ec,inc;AreTangent⁡ec,ex1;AreTangent⁡ec,ex2
AreTangent⁡ec,ex3
draw⁡inc⁡color=yellow,ec⁡color=plum,ex1⁡color=green,T⁡color=blue,filled=false,filled=true,title=`Illustration of Feuerbach's Theorem`
Theorem: In triangle A1A2A3 let M1, M2, M3 be the midpoints of the sides A2A3, A3A1, A1A2, H1, H2, H3 the feet of the altitudes on these sides, N1, N2, N3 the midpoints of the segments A1H, A2H, A3H, where H is the orthocenter of the triangle. Then the nine points M1, M2, M3, H1, H2, H3, N1, N2, N3 lie on a circle whose center N is the midpoint of the segment joining the orthocenter H to the circumcenter O of the triangle, and whose radius is half the circumradius of the triangle.
Define the triangle A1A2A3
triangle⁡T,point⁡A2,0,0,point⁡A1,2,4,point⁡A3,7,0:
Find the midpoints of A2A3, A1A3, A1A2
midpoint⁡M1,A2,A3:midpoint⁡M2,A3,A1:midpoint⁡M3,A1,A2:
Find the orthocenter and circumcenter of ABC
orthocenter⁡H,T:circumcircle⁡c,T,'centername'=O:
Find the altitudes of ABC
altitude⁡A1H1,A1,T,H1:altitude⁡A2H2,A2,T,H2:
altitude⁡A3H3,A3,T,H3:
Define the points N1, N2, N3
midpoint⁡N1,A1,H:midpoint⁡N2,A2,H:midpoint⁡N3,A3,H:
circle⁡c1,midpoint⁡N,H,O,1⁢radius⁡c2:
Check if M1, M2, M3, H1, H2, H3, N1, N2, N3 are on circle c1
IsOnCircle⁡M1,c1;IsOnCircle⁡M2,c1;IsOnCircle⁡M3,c1
IsOnCircle⁡H1,c1;IsOnCircle⁡H2,c1;IsOnCircle⁡H3,c1
IsOnCircle⁡N1,c1;IsOnCircle⁡N2,c1;IsOnCircle⁡N3,c1
draw⁡c1⁡filled=true,color='COLOR'⁡RGB,1.00000000,1.00000000,0.8000000000,c⁡filled=true,color=green,T⁡color=blue,N,M1,M2,M3,H1,H2,H3,N1,N2,N3,H,axes=none
The following shows how to use geometry package to construct curves based on the method called an envelope of circles.
Reference: Pedoe, Dan. Geometry And The Liberal Arts. St. Martin's Press, 1978.
cardioid:
Define the base circle
circle⁡c0,point⁡o,0,0,1:
Generate a random point A0 on the circle which is the cusp of
the cardioid
randpoint⁡A0,c0:
Generate 80 circles which envelope the constructed cardioid
i ≔ 1:n ≔ 80:
whilei≤ndorandpoint⁡A||i,c0;ifevalf⁡HorizontalCoord⁡A0−HorizontalCoord⁡A||i≠0thencircle⁡c||i,A0,A||i;i ≔ i+1end ifend do:draw⁡seq⁡c||i,i=0..n,printtext=false,title=`construction of a cardioid`
limacon de monsieur Pascal
Pick a point outside the circle
point⁡A0,2,0:
Generate 80 circles which envelope the constructed limacon
whilei≤ndorandpoint⁡A||i,c0;ifevalf⁡HorizontalCoord⁡A0−HorizontalCoord⁡A||i≠0thencircle⁡c||i,A0,A||i;i ≔ i+1end ifend do:draw⁡seq⁡c||i,i=0..n,printtext=false,title=`construction of a limacon de monsieur Pascal`
limacon without an inner loop
circle⁡c0,point⁡o,0,0,2:
Pick a point which is inside the circle c0
point⁡A0,1,0:
whilei≤ndorandpoint⁡A||i,c0;ifevalf⁡HorizontalCoord⁡A0−HorizontalCoord⁡A||i≠0thencircle⁡c||i,A0,A||i;i ≔ i+1end ifend do:draw⁡seq⁡c||i,i=0..n,printtext=false,title=`construction of a limacon without an inner loop`
nephroid
Pick a diameter of c0
line⁡l,point⁡M,0,−2,point⁡N,0,2:
Generates 100 points on the circle, and for each point
Ai, construct a circle with center Ai that touches the line l
n ≔ 100:
foritondorandpoint⁡A||i,c0;circle⁡c||i,A||i,distance⁡A||i,lend do:draw⁡seq⁡c||i,i=1..n,printtext=false,title=`construction of a nephroid`
The following shows the use of transformations (translation, rotation and dilatation).
An example of translation, rotation, and dilatation of circles
angle ≔ table⁡:
n ≔ 8:
foritondoanglei ≔ 2⁢Pi⁢inend do:dsegment⁡dseg,point⁡A,0,0,point⁡B,4,0:point⁡o,0,0:circle⁡c,o,1:homothety⁡c1,c,32,point⁡M,−1,0:homothety⁡c2,c,2,point⁡M,−1,0:homothety⁡c3,c,52,point⁡M,−1,0:translation⁡t,c,dseg:translation⁡tt,c1,dseg:translation⁡ttt,c2,dseg:translation⁡tttt,c3,dseg:forito8dorotation⁡t||i,t,anglei,counterclockwise,o;rotation⁡tt||i,tt,anglei,counterclockwise,o;rotation⁡ttt||i,ttt,anglei,counterclockwise,o;rotation⁡tttt||i,tttt,anglei,counterclockwise,oend do:square⁡sqr,point⁡A,−8,−8,point⁡B,8,−8,point⁡C,8,8,point⁡E,−8,8:draw⁡seq⁡op⁡t||i⁡color=red,tt||i⁡color=green,ttt||i⁡color=blue,tttt||i⁡color=plum,i=1..n,sqr⁡color='COLOR'⁡RGB,1.00000000,1.00000000,0.8000000000,printtext=false,filled=true,axes=none,title=`An example of translation, rotation, dilatation of a circle`
Eves, Howard. A Survey of Geometry. Allyn and Bacon, 1972.
Pedoe, Daniel. Geometry and the Liberal Arts. St. Martin's Press, 1978.
See Also
geometry
Download Help Document