Next: Iterative Statements, Previous: Input and Output [Contents][Index]
Syntax for conditional statement is:
if assertion block { { elseif assertion block } … else block } end
Example:
if x < 0 print "x is negative." elseif x > 0 print "x is positive." else print "x is null." end
Using the stop command within a conditional statement allows one to abort the
execution of a script when some condition is met.
not aNegation of assertion a.
a and bDisjunction of assertions a and b.
a or bConjunction of assertions a and b.
truefalsea == bChecks whether objects a and b are equal, i.e. have the same internal representation. Objects may be numbers, strings, points, vectors, sets, lines, circles or conics.
a != bNegation of the former.
x < yx <= yx > yx >= yComparison of numbers x and y.
A in sChecks whether point A belongs to set s.
empty(s)Checks for emptiness of set s.
A on sChecks whether point A is on object s, where s may be a set (considered as an open path), a line, a circle or a conic.
collinear(A, B, C)Checks whether points A, B and C are collinear.
collinear(u, v)Checks whether vectors u and v are collinear, i.e. have same or opposite directions.
parallel(l, l')perpendicular(l, l')Direction comparison of lines l and l'.
ellipse(c)hyperbola(c)parabola(c)Type checking of conic c.
isosceles(A, B, C)equilateral(A, B, C)right(A, B, C)Type checking of triangle ABC.
parallelogram(A, B, C, D)rectangle(A, B, C, D)square(A, B, C, D)Type checking of quadrilateral ABCD.
epsTrue with eukleides.
pstricksTrue with euktopst.
displayTrue within GUI.
assertion ? x | yNumber x if assertion is true, number y otherwise.
Next: Iterative Statements, Previous: Input and Output [Contents][Index]