FPT(3L)

NAME
fpt: fPt, fRpt, fRect - create a Point or Rectangle from arguments

SYNOPSIS
#include <dmd.h>

Point fPt (x, y)
int x, y;

Rectangle fRpt (p, q)
Point p, q;

Rectangle fRect (a, b, c, d)
int a, b, c, d;

DESCRIPTION

The fPt function returns a point made from the two arguments.

The fRpt function returns a rectangle made from the two points.

The fRect function returns a rectangle made from the four arguments. This function differs from canon(3R) in that the points are not sorted first to guarantee a positive area.

The above functions are not macros as are the ones in pt(3L); therefore, allow C language assignment constructs.

EXAMPLE
The following subroutine draws two boxes in the upper left corner of the window.
#include <dmd.h>
Point fPt();
Rectangle fRpt();
Rectangle fRect();
Point add();
Rectangle raddp();
drawboxes()
{
	Rectangle r;

	r = fRpt(Drect.origin, add(Drect.origin, Pt(100,100)));
	box(&display, r, F_STORE);
	r = fRect(0,0,200,200);
	box(&display, raddp(r, Drect.origin), F_STORE);
}

SEE ALSO
canon(3R), pt(3L).