Example Use of the Geometry Package
|
Description
|
|
•
|
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.
|
|
|
Examples
|
|
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
Define triangle ABC
>
|
triangle(T,[point(A,0,0),point(B,3,-1),point(C,6,2)]):
|
Find the incircle of ABC
>
|
incircle(inc,T,'centername'=II):
|
Find the excircles , , of ABC
>
|
excircle(obj,T,[ex1(I1),ex2(I2),ex3(I3)]):
|
Find the nine-point circles of ABC
>
|
EulerCircle(ec,T,'centername'=X):
|
Check if , , , are tangent to
>
|
AreTangent(ec,inc); AreTangent(ec,ex1); AreTangent(ec,ex2);
|
>
|
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/2*radius(c)]):
|
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,.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
Generate 80 circles which envelope the constructed cardioid
>
|
while i <= n do
randpoint(A||i, c0);
if evalf(HorizontalCoord(A0)-HorizontalCoord(A||i)) <> 0 then
circle(c||i, [A0, A||i]);
i := i+1;
end if;
end do:
draw({seq(c||i,i=0..n)}, printtext=false,
title=`construction of a cardioid`);
|
limacon de monsieur Pascal
Define the base circle
>
|
circle(c0, [point(o,0,0), 1]):
|
Pick a point outside the circle
Generate 80 circles which envelope the constructed limacon
>
|
while i <= n do
randpoint(A||i,c0);
if evalf(HorizontalCoord(A0)-HorizontalCoord(A||i)) <> 0 then
circle(c||i, [A0, A||i]);
i := i+1;
end if;
end do:
draw({seq(c||i, i=0..n)}, printtext=false, title=
`construction of a limacon de monsieur Pascal`);
|
limacon without an inner loop
Define the base circle
>
|
circle(c0, [point(o,0,0), 2]):
|
Pick a point which is inside the circle c0
Generate 80 circles which envelope the constructed limacon
>
|
while i <= n do
randpoint(A||i,c0);
if evalf(HorizontalCoord(A0)-HorizontalCoord(A||i)) <> 0 then
circle(c||i, [A0, A||i]);
i := i+1;
end if;
end do:
draw({seq(c||i, i=0..n)}, printtext=false, title=
`construction of a limacon without an inner loop`);
|
nephroid
Define the base circle
>
|
circle(c0, [point(o,0,0), 1]):
|
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
>
|
for i to n do
randpoint(A||i, c0);
circle(c||i, [A||i, distance(A||i,l)]);
end 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
>
|
for i to n do angle[i] := 2*Pi*i/n end do:
dsegment(dseg, point(A,0,0), point(B,4,0)): point(o,0,0):
circle(c, [o,1]):
homothety(c1, c, 3/2, point(M, -1, 0)):
homothety(c2, c, 2, point(M, -1, 0)):
homothety(c3, c, 5/2,point(M, -1, 0)):
translation(t, c, dseg):
translation(tt, c1, dseg):
translation(ttt, c2, dseg):
translation(tttt, c3, dseg):
for i from 1 to 8 do
rotation(t||i, t, angle[i], counterclockwise, o);
rotation(tt||i, tt, angle[i], counterclockwise, o);
rotation(ttt||i, ttt, angle[i], counterclockwise, o);
rotation(tttt||i, tttt, angle[i], counterclockwise, o);
end 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,.8000000000))],
printtext=false, filled=true, axes=none, title=
`An example of translation, rotation, dilatation of a circle`);
|
|
|
References
|
|
|
Eves, Howard. A Survey of Geometry. Allyn and Bacon, 1972.
|
|
Pedoe, Daniel. Geometry and the Liberal Arts. St. Martin's Press, 1978.
|
|
|