Graphics Reference
In-Depth Information
Intersection of line and plane.
Given parametric line P
(
s
)=
A
+
s
(
B
A
)
and
implicit plane (or 2D line)
(
P
C
) ·
N
=
0, we find s plane such that
(
A
+
s plane (
B
A
) ·
N
=
0. This yields
·
A
N
s plane =
N .
(
A
B
) ·
Smallest distance between two lines. Given two lines, one through A and B
and one through C and D , we first find a vector perpendicular to each of the lines:
N
=(
B
A
) × (
D
C
)
If this vector has zero length then the lines are parallel, and we can compute the
minimum distance from the point C to the line through A and B . If the length
is not zero, we can write an equation of a plane that contains the line AB and
is parallel to the other line:
(
p
a
) ·
n
=
0. Now simply compute the minimum
distance from C to that plane.
B.4
Orthonormal Matrices
We have seen the Cartesian coordinates with our familiar xyz axes. We could
also pick a different set of three mutually perpendicular axes uvw . Although a
vector does not change when going back and forth between xyz and uvw , its three
components in Cartesian representation do. Recall that the components just give
you a way to say how the axis vectors combine. If you want the same vector in
each coordinate system, that means
x V x +
y V y +
z V z =
u V u +
v V v +
w V w .
are the same in the two coordinate systems, but
you need to be sure to turn them into vectors by multiplying by the appropriate
axis vectors for that coordinate system.
Suppose you have the uvw basis vectors stored in xyz coordinates (as will
almost always be the case):
So the vectors
(
x
,
y
,
z
)
and
(
u
,
v
,
w
)
V w =(
x w ,
y w ,
z w ) ,
V u =(
x u ,
y u ,
z u ) ,
V v =(
x v ,
y v ,
z v ) .
And now suppose you wanted a matrix that would take an
(
x
,
y
,
z
)
and produce the
equivalent
(
u
,
v
,
w
)
or vice-versa. That matrix would be a rotation because you
Search WWH ::




Custom Search