The P3DC point types are **p3dc_PNT2**, **p3dc_PNT3**,
and **p3dc_PNT4**. They represent 1x2, 1x3 and 1x4
element matrices respectively. There are several functions
defined that operate on these data structures however they are
primarily implemented as #define statements in the p3dc.h include
file.

The following functions are described in this document:

- scaleXX -- scaleP2, scaleP3, and scaleP4
- interceptXX -- interceptP2, interceptP3, interceptP4
- p3dc_dot_pnt3
- p3dc_diff_pnt3
- p3dc_cross_pnt3

The defined functions are as follows.

*p3dc_FLOAT ***scale****XX****(***var*,
*scalar***)**

Where the value

XXis one ofP2,P3, orP4. This function multiplies a two, three, or four component vector respectively by a scalar value.

*void ***intercept****XX****(***first_endpoint,
second_endpoint, dT*, *result_endpoint***)**

Again where the value of

XXis one ofP2,P3, orP4. This function computes the value of a point along a line segment using the valuedTto determine the result endpoint. These functions are used in the clipping code when clipping polygons.

*p3dc_FLOAT ***p3dc_dot_pnt3****(***vector_a*,
*vector_b***)**

This function computes the dot product (scalar product) of two three element vectors. It is returned as a floating point value. Note that the statement

scaleP3(vec, 1/p3dc_dot_pnt3(vec, vec))

normalizes the vector to unit length.

*void ***p3dc_diff_pnt3****(***vector_a,
vector_b, result_vector***)**

This function computes the vector difference

R=B-A. Effectively this stores in result a vector, then when added toAwill give youB.

*void ***p3dc_cross_pnt3****(***vector_a*,
*vector_b*, *result_vector***)**

This function finds the cross product (vector product) of the vectors

AandB. Mathematically this is written asR = A X B. This function is great for finding a plane normal if you have three points.