RECTARITH(3R)

NAME
rectarith: raddp, rsubp - arithmetic on Rectangles

SYNOPSIS
#include <dmd.h>
Rectangle raddp (r, p)

Rectangle rsubp (r, p)

Rectangle r;
Point p;

DESCRIPTION
The raddp function returns the Rectangle defined by (add(r.origin, p), add(r.corner, p)).

The rsubp function returns the Rectangle defined by (sub(r.origin, p), sub(r.corner, p)).

EXAMPLE
The following code will return a rectangle with the mouse coordinates at the center of the box.

    #include <dmd.h>
    Rectangle
    makebox()
    {
    return (raddp (Rect(-15, -15, 15, 15),
              mouse.xy));
    }

SEE ALSO
ptarith(3R), structures(3R).