# Definition of an exercise ruler & compass.
# syntax of the file.
# points:  each line defines a point.  x,y
# lines:   each line defines two points on a line.   x1,y1,x2,y2,type
#          type: 1 (segment), 2 (line), 3 (semiline direct), 4 (semiline inverse)
#	   type is facultative, defaulting to 1.
# circles: each line defines a circle. x,y,r,n
#	   where (x,y) is the center, r=radius,
#          n is the number of point for the center (if n>0).
# goal: each line defines an object. First item is the type of the object
# (point,line or circle), the rest are parameters (same as above).
# goal_text: text explaining the goal. (language-dependent)

title=Barycenter of a triangle

a=!random 0,2*pi
a1=!random pi/5,2*pi/3
a2=!random 2*$a1,2*pi-$a1

points=10*cos($a),10*sin($a)\
10*cos($a+$a1),10*sin($a+$a1)\
10*cos($a+$a2),10*sin($a+$a2)
lines=10*cos($a),10*sin($a),10*cos($a+$a1),10*sin($a+$a1),1\
10*cos($a+$a1),10*sin($a+$a1),10*cos($a+$a2),10*sin($a+$a2),1\
10*cos($a+$a2),10*sin($a+$a2),10*cos($a),10*sin($a),1

goal=point,10*(cos($a)+cos($a+$a1)+cos($a+$a2))/3,10*(sin($a)+sin($a+$a1)+sin($a+$a2))/3
goal_text=trouver le barycentre du triangle 1 2 3
hint=The barycenter of a triangle is the common point of the three medians\
(lines joining a vertex and the middle of the opposite side). \
You have only to draw two of them,\
then mark the intersection.
solution=middle,1,2\
middle,1,3\
middle,2,3\
segment,1,6\
segment,2,5\
segment,3,4\
point,line,4,line,5

