# 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=Parallelogram

a=!random 0,2*pi
b=!random $a-pi/3,$a+pi/3
r=!random -1,1
r=$[exp($r)]

points=cos($a),sin($a)\
-$r*sin($b),$r*cos($b)\
$r*sin($b),-$r*cos($b)
lines=cos($a),sin($a),-$r*sin($b),$r*cos($b),1\
cos($a),sin($a),$r*sin($b),-$r*cos($b),1

goal=point,-cos($a),-sin($a)\
line,-cos($a),-sin($a),-$r*sin($b),$r*cos($b),1\
line,-cos($a),-sin($a),$r*sin($b),-$r*cos($b),1
goal_text=construct the parallelogram with points 1,2,3 as 3 vertices
hint=We can use the fact that the center of the parallelogram is the\
middle of two opposite vertices.
solution=middle,2,3\
semiline_direct,1,4\
circle,4,1\
point,line,3,circle,1\
segment,2,5\
segment,3,5\
hide,circle,1\
hide,line,3

