RoboCompass has 10 drawing commands and 12 helper commands.Drawing commands can be assigned to labels and referenced in other commands.In effect,these commands can be combined in creative ways to produce all sorts of Geometrical constructions.
point(x,y)
A=point(3,4)line(x1,y1,x2,y2)
line(0,0,-2,5)arc(originPoint,radius,angleFrom,upto)
arc(point1,point2,originPoint,angleFrom,upto)
perp(line,passThroughPoint,length=10)
A=perp(line(1,2,3,4),point(1,2))
perp(A,B)
parallel(line,passThroughPoint,length=10)
parallel(line(1,2,3,4),point(1,2))
parallel(A,B)angle(point1,point2,degrees)
angle(point(2,0),point(6,0),45)
angle(A,B,90,1)polygon(comma seperated points)
polygon(point(2,2),point(4,2),point(3,5))
polygon(A,B,C)findangle(2 lines or a polygon)
findangle(A,B)fill(A,B,fillType=0,output=1)
fill(A)trace(comma seperated points)
trace(point(0,0),point(1,sin(30)),point(1,sin(60)),point(1,sin(120)),B)As a general rule,where ever point is expected in an expression, we can use either point(2,3) or use its label or use a helper command which calculates and returns a point.Similarly wherever a line is expected we can give the label of a line or the label of two points.
For example arc(A,B,point(2,1),50,40) uses the distance from A to B and draws the arc from point(2,1).(note:- instead of point(2,1) we can use 'C' if we have a point labled C.
dist(point1, point2)
dist(point(2,1),point(1,2))start(line or arc)
line(point(2,1),start(G))
point(start(line(2,1,1,2)))end(line or arc)
line(point(2,1),end(G))
point(end(line(2,1,1,2)))X(point)
A=X(point(2,1))
X(A)Y(point)
B=Y(point(1,2))
Y(A)intersect(object1,object2,index=1)
G=point(intersect(D,E))
intersect(D,E,2)reflect(object,line)
reflect(point(2,2),line(4,0,4,4))
reflect(D,A)rotate(object,angle,withrespectTo=point(0,0))
rotate(point(2,2),90,point(0,0))
rotate(D,30,A)translate(object,x,y,withrespectTo=point(0,0))
translate(arc(2,3,0,180),2,3,point(2,1))
translate(G,2,4)dilate(object,scaleFactor,withRespectTo=point(0,0))
dilate(point(3,1),2)
project(point1,line)
project(point(2,2),line(0,0,1,0))
project(A,line(0,0,1,0))interpolate(point1,point2,ratio)
interpolate(point(0,0),point(10,0),0.3)
interpolate(A,B,0.5)hide(comma separated labels)
hide(A,B,C,D)
show(A,B,C,D)All standard Math functions like sin,cos,tan,asin,acos,atan,log,sqrt,max,min are supported. Note:Trignometric functions uses degrees as unit.