Program "Algebra of Geometric Constructions".

Examples for Additional Commands.

 

 

See a page commands and new commands for explanations and list of commands used below.

 

Example 1.

New commands allow to write shorter and simpler source files. First example shows exact value of height of a triangle ABC.

start()
A=point(100,400)
B=point(500,600)
C=point(200,200)

T1=Triangle(A,B,C)

E1=AngleOfTriangle(T1,3)
E2=PiDiv2

E3=AnglesDiff(E2,E1)

S1=SideOfTriangle(T1,2)

//S1 is a side BC of triangle ABC

T2=Triangle(S1,E1,E3)

S2=SideOfTriangle(T2,2)
DrawSide(300,300,S2)

END

 

Example 2.

The following example constructs a triangle T2 with 2 vertices being vertices of another triangle T1 and third vertex being the center of inscribed circle of T1. Exact value of length of one side of this triangle T2 is shown. This length it is a distance of one of vertex of T1 to the center of the inscribed circle of T1.

 

start()
A=point(400,500)
B=point(700,500)
C=point(600,300)
T1=Triangle(A,B,C)
//We constructed triangle T1
E11=AngleOfTriangle(T1,1)
DrawCosine(200,200,E11)

//Program writes exact value of cosine
//of one angle of triangle T1

E12=HalfAngle(E11)
DrawCosine(200,300,E12)

Text(160,120,$cosine of angle of triangle)
Text(160,140,$below cosine of half of this angle)

/Program writes exact value of cosine
//of half of angle of triangle T1

E21=AngleOfTriangle(T1,2)
DrawCosine(600,200,E21)
E22=HalfAngle(E21)
DrawCosine(600,300,E22)

//The same as before with a second vertex
S1=SideOfTriangle(T1,1)
T2=Triangle(S1,E12,E22)

//T2 is a triangle with 2 vertices of T1
//and third vertex is center of inscribed circle of T1


S=SideOfTriangle(T2,2)
DrawSide(200,500,S)

Text(300,500,$Distance of a vertex of T1 to center of inscribed circle)
END

 

 

Example 3.

In this example P is a regular pentagon for which the inscribed circle has radius 1. It is the same polygon as in the example 3 and example 4 of the page examples. Having P we construct exact values of a regular pentagon having sides of length 1.

 

#include <pentagon.ltu>


start()
P=Pentagon()

A=vertex(P,1)
B=vertex(P,2)
C=vertex(P,3)

X=point(100,100)
Y=point(200,100)

S=Side(X,Y)

T1=Triangle(A,B,C)
E1=AngleOfTriangle(T1,3)

Text(300,182,$Cosine of an angle of) 
Text(300,195,$a regular pentagon)
DrawCosine(400,250,E1)

T2=Triangle(S,S,E1)
S1=SideOfTriangle(T2,1)

Text(500,169,$Length of a diagonal of a )
Text(500,182,$regular pentagon with a )
Text(500,195,$side of length 1)
DrawSide(600,250,S1)

E2=HalfAngle(E1)

Text(295,370,$Cosine of half of an angle of) 
Text(295,382,$a regular pentagon)
DrawCosine(400,440,E2)

Text(550,350,$Radius of a circumscribed ) 
Text(550,362,$circle of a regular pentagon )
Text(550,375,$with side of length1)
T3=Triangle(S,E2,E2)
S2=SideOfTriangle(T3,2)
DrawSide(630,440,S2)

S3=DivSide(S,2)
E3=PiDiv2
T3=Triangle(S3,E3,E2)

S4=SideOfTriangle(T3,3)

Text(850,110,$Radius of inscribed circle ) 
Text(850,122,$of a regular pentagon )
Text(850,135,$with side of length 1)
DrawSide(950,195,S4)

END