73 #define CROSSPRODUCT(p1,p2,p3) \
74 (p3).x = (p1).y*(p2).z - (p1).z*(p2).y; \
75 (p3).y = (p1).z*(p2).x - (p1).x*(p2).z; \
76 (p3).z = (p1).x*(p2).y - (p1).y*(p2).x
77 #define DOTPRODUCT(v1,v2) ((v1).x*(v2).x + (v1).y*(v2).y + (v1).z*(v2).z)
132 VEC3F A, u, Q, PQ, PR, QP, QP2;
149 len = sqrt((Px-P1x)*(Px-P1x) +
226 int main(
int argc,
char **argv)
233 Px = 5; Py = 2; Pz = 0;
234 P1x = 5; P1y = 2; P1z = 0;
235 P2x = 10; P2y = 2; P2z = 0;
242 printf(
"*** Distance is %f; Point R is %f %f %f; f is %f\n",
int main(int argc, char **argv)
REAL blPointLineDistance(REAL Px, REAL Py, REAL Pz, REAL P1x, REAL P1y, REAL P1z, REAL P2x, REAL P2y, REAL P2z, REAL *Rx, REAL *Ry, REAL *Rz, REAL *frac)
#define DOTPRODUCT(v1, v2)
#define CROSSPRODUCT(p1, p2, p3)
Type definitions for maths.