DESCRIPTION

The functions
Pt,Rect
and
Rpt
construct geometrical data types from their components.

Addpt
returns the Point
sum of its arguments:
Pt(p.x+q.x,p.y+q.y).Subpt
returns the Point
difference of its arguments:
Pt(p.x-q.x,p.y-q.y).Mulpt
returns the Point
Pt(p.x*a,p.y*a).Divpt
returns the Point
Pt(p.x/a,p.y/a).

Canonrect
returns a rectangle with the same extent as
r,
canonicalized so that
min.x
≤
max.x,
and
min.y
≤
max.y.

Eqpt
compares its argument Points and returns
0 if unequal,
1 if equal.
Eqrect
does the same for its argument Rectangles.

Ptinrect
returns 1 if
p
is a point within
r,
and 0 otherwise.

Rectinrect
returns 1 if all the pixels in
r
are also in
s,
and 0 otherwise.

RectXrect
returns 1 if
r
and
s
share any point, and 0 otherwise.

Rectclip
clips in place
the Rectangle pointed to by
rp
so that it is completely contained within
b.
The return value is 1 if any part of
*rp
is within
b.
Otherwise, the return value is 0 and
*rp
is unchanged.

Combinerect
overwrites
*rp
with the smallest rectangle sufficient to cover all the pixels of
*rp
and
b.