Next: , Previous:   [Contents][Index]


3.4 Quadrilaterals

Quadrilateral assignments consist in a list of four variable names followed by either parallelogram, rectangle or square, and some optional parameters.

Example: A B C D parallelogram 6, 3, 60°

In the following, we will use letter x for the first side of the quadrilateral, i.e. the segment joining the first and the second vertices, y for the fourth side, i.e. the segment joining the first and the fourth vertices, u and v the corresponding vectors. Likewise, we will use letter a for the first angle, and b for the angular direction of the first side.

In quadrilateral assignments, one, two or three vertices may be predefined. Like with triangular assignments, if no vertices are predefined then the first variable is set to the origin of the implicit coordinate system. The direction of the first side is horizontal unless specified by an angular value at the end of the parameter list. If two vertices are predefined then the parameters giving the length and the orientation of the first side have to be omitted. If three vertices are predefined then only parallelogram is valid.

Generic quadrilateral assignments

parallelogram { x, } y, a { , b }
rectangle { x, } y, { , b }
square { x { , b } }

Default quadrilateral assignments

Default assignments, i.e. assignments without parameters, are only valid with at most one predefined vertex.

parallelogram

Assigns a parallelogram such as x = 5, y = 4 and a = 75°.

rectangle

Assigns a golden rectangle such as x = 6.

square

Assigns a square such as x = 4.

Vector based quadrilateral assignment

This assignment is only valid with at most one predefined vertex.

parallelogram u, v, a

Next: , Previous:   [Contents][Index]