# Point functions [Math]

## Data Structures

struct  POINT32
2D Point struct More...

## Functions

INLINE POINT * pt_set (POINT *pd, int x, int y)
Initialize pd to (x, y).
INLINE POINT * pt_add (POINT *pd, const POINT *pa, const POINT *pb)
Point addition: pd = pa + pb.
INLINE POINT * pt_sub (POINT *pd, const POINT *pa, const POINT *pb)
Point subtraction: pd = pa - pb.
INLINE POINT * pt_scale (POINT *pd, const POINT *pa, int c)
Point scale: pd = c * pa.
INLINE POINT * pt_add_eq (POINT *pd, const POINT *pb)
Point increment: pd += pb.
INLINE POINT * pt_sub_eq (POINT *pd, const POINT *pb)
Point decrement: pd -= pb.
INLINE POINT * pt_scale_eq (POINT *pd, int c)
Point scale: pd *= c.
INLINE int pt_cross (const POINT *pa, const POINT *pb)
Point 'cross'-product: pa × pb.
INLINE int pt_dot (const POINT *pa, const POINT *pb)
Point 'dot'-product:pa · pb.
int pt_in_rect (const POINT *pt, const struct RECT *rc)

## Function Documentation

 INLINE int pt_cross ( const POINT * pa, const POINT * pb )

Point 'cross'-product: pa × pb.

Actually, there's no such thing as a 2D cross-product, but you could extend it to 3D and get the value of its z-component, which can be used for a test for parallelism.

Generated on Mon Aug 25 17:03:57 2008 for libtonc by  1.5.3