Previous Up Next

26.15.7  Checking whether an object in the plane is a right triangle or a rectangle

See Section 27.11.11 for checking for right triangles and rectangles in 3D geometry.

The is_rectangle command determines whether or not a geometric object is a rectangle or right triangle.

Examples

is_rectangle(1,1+i,i)
     
2           
is_rectangle(1+i,-2+i,-2-i,1-i)
     
1           
R:=rectangle(-2-i,1-i,3,C,D); is_rectangle(R[0])
     
1           

Note that R[0] is a rectangle since R is a list made of a rectangle and vertices C and D.

affix(C,D)
     
−2+8 i,1+8 i           

Previous Up Next