Graphics Reference
In-Depth Information
v = D - B
D
IV
III
III
IV
A
C
I
II
II
I
u = C - A
B
Figure 3.7 Given a quadrilateral ABCD , the magnitude of the cross product of the two
diagonals AC and BD equals twice the area of ABCD . Here, this property is illustrated by the
fact that the four gray areas of the quadrilateral are pairwise identical to the white areas, and
all areas together add up to the area of the parallelogram spanned by AC and BD .
where
t 1
=
u 1
u 2 ,
t 2
=
v 2
+
v 3 ,
t 3
=
u 1 v 3 ,
and
t 4
=
t 1 t 2
t 3 .
Because this formulation increases the total number of operations from 9 (6 multiplies,
3 additions) to 13 (5 multiplies, 8 additions), any eventual practical performance
benefit of such a rewrite is hardware dependent.
Given a triangle ABC , the magnitude of the cross product of two of its edges equals
twice the area of ABC . For an arbitrary non self-intersecting quadrilateral ABCD , the
magnitude
e
of the cross product of the two diagonals, e
=
( C
A )
×
( D
B ),
equals twice the area of ABCD . This property is illustrated in Figure 3.7.
There is no direct equivalent of the cross product in two dimensions, as a third
vector perpendicular to two vectors in the plane must leave the plane and the 2D
space. The closest 2D analog is the 2D pseudo cross product , defined as
u ·
v ,
where u =
u 2 , u 1 ) is the counterclockwise vector perpendicular to u . The term u
is read “u-perp.” For this reason, the pseudo cross product is sometimes referred to
as the perp-dot product . The 2D pseudo cross product is a scalar, the value of which —
similar to the magnitude of the cross product — corresponds to the signed area of
the parallelogram determined by u and v . It is positive if v is counterclockwise from
u , negative if v is clockwise from u , and otherwise zero.
Again, given the (3D) triangle ABC , note that each component of the cross product
vector d
(
A ) consists of a 2D pseudo cross product (with the middle
component being negated). Therefore, each component of d holds twice the signed
area of the projection of ABC onto the yz , zx , and xy planes, respectively. A single cross
product operation is therefore sufficient for determining the result of a 2D point-in-
triangle test, which can be useful if a cross product operation is directly supported in
hardware.
=
( B
A )
×
( C
Search WWH ::




Custom Search