See section 12.8.3 for rectangles in space.
The rectangle command takes three mandatory arguments and one or two optional arguments. The mandatory arguments are two points A and B and a nonzero real number k.
rectangle returns and draws the rectangle ABCD, where
AD=|k|·AB and the angle from
AB to AD is counterclockwise if k > 0,
clockwise if k<0.
Input:
Output:
Input:
Output:
The optional fourth and fifth arguments need to be
variable names which will be assigned to vertices C and
D.
Input:
Output:
Input:
Output:
Given rectangle(A,B,k), Xcas computes D
by affix(D) = affix(A) +
kexp(iπ/2)(affix(B)−affix(A)). If
k is complex, then rectangle draws a
parallelogram.
Input:
Output: