Graphics Reference
In-Depth Information
where y is the angle from A to B ,0< y < 180
jA Bj¼
0 if and only if A and B are colinear
;
(B.29)
i.e., sin y ¼
sin 0
¼
0, or A ¼
0or B ¼
0.
B.2.5 Vector and matrix routines
Simple vector and matrix routines are given here ( Figure B.12 ). These are used in some of the routines
presented elsewhere in this appendix.
Vector routines
Some vector routines can be implemented just as easily as in-line code using C's #define construction.
B.2.6 Closest point between two lines in three-space
The intersection of two lines in three-space often needs to be calculated. Because of numerical impre-
cision, the lines rarely, if ever, actually intersect in three-space. As a result, the computation that needs
to be performed is to find the two points, one from each line, at which the lines are closest to each other.
FIGURE B.12
Vector routines.
 
Search WWH ::




Custom Search