Cross Product Example

This CrossProductExample is a long-winded way of calculating the AngleBetweenDodecahedronFaces. This page illustrates how CrossProducts can be used to find mutually perpendicular vectors.

It also illustrates how general techniques can give exceedingly long and complex calculations, whereas (in this example), a little thought can reduce the calculation required by 60 percent. The shorter solution is on the AngleBetweenDodecahedronFaces page.


Coordinate System (for this page only)

 Let's set up a temporary coordinate system,
 just for finding the arc-length of an icosahedron edge.

Let s = length of a dodecahedron edge. Let (x=0, y=0, z=0) be a corner of the dodecahedron. Let x increase directly away from the center of one dodecahedron face touching (x=0, y=0, z=0). Let the y-axis be perpendicular to the x-axis, such that this dodecahedron face is in the x-y plane. z=0 at the center of this dodecahedron face. Let z increase toward the center of the dodecahedron from the center of this dodecahedron face. Let phi = altitude above the x-y plane of the third dodecahedron edge that goes through (x=0, y=0, z=0).


Some corners of adjoining faces

 The angle of a regular pentagon corner is 108°.

The following points are corners of the first dodecahedron face OABCD: O = (x=0, y=0, z=0) A = (x=s*cos( 126°), y=s*sin( 126°), z=0) B = (x=s*cos(-126°), y=s*sin(-126°), z=0)

The following points are corners of another dodecahedron face EFGOA: O = (x=0, y=0, z=0) A = (x=s*cos( 126°), y=s*sin(126°), z=0) G = (x=s*cos( phi ), y=0, z=s*sin(phi))


Solving for phi

 The distance between the extreme points (AB or AG) = 2*s*sin(126°)
 (distance(AB))^2  = (distance(AF))^2
 (2*s*sin(126°))^2 = (s*cos(phi) - s*cos(126°))^2 + (s*sin(126°))^2 + (s*sin(phi))^2
 (2 * sin(126°))^2 = (  cos(phi) -   cos(126°))^2 + (  sin(126°))^2 + (  sin(phi))^2 
                   = (cos(phi))^2 - 2*cos(phi)*cos(126°) + (cos(126°))^2 +(sin(126°))^2 + (sin(phi))^2 

= 2 - 2*cos(phi)*cos(126°)

2*cos(phi)*cos(126°) = 2 - (2 * sin(126°))^2 cos(phi)*cos(126°) = 1 - 2 *(sin(126°))^2 = 1 - 2 *(sin(54°))^2 = cos(108°) -cos(phi)*cos( 54°) = -cos( 72°) cos(phi) = cos( 72°) / cos( 54°) phi = arccos(cos( 72°) / cos( 54°)) sin(phi) = sin(arccos(cos( 72°) / cos( 54°)))


Vector perpendicular to face OABCD:

 The following vectors are perpendicular to the first face: 
 The cross product (OA x OB)
 (OA x OB) = <xA, yA, zA> x <xB, yB, zB>
           = s*<cos( 126°), sin( 126°), 0> x s*<cos(-126°), sin(-126°), 0>
           = <yA*zB - yB*zA, -xA*zB + xB*zA, xA*yB - xB*yA>
           = s*s* <0, 0, cos( 126°)*sin(-126°) - cos(-126°)*sin( 126°)>
           = s*s* <0, 0, -cos(54°)*(-sin(54°)) - (-cos(54°)*sin(  54°)>
           = s*s* <0, 0,  cos(54°)* sin(54°)   + cos(54°)  *sin(  54°)>
           = s*s* <0, 0, 2 * cos(54°) * sin(54°)>
           = s*s* <0, 0, sin(108°)>
           = s*s* <0, 0, sin( 72°)>
           = s*s*sin( 72°)* <0, 0, 1>
 which has a magnitude of:  
   s*s* sin(72°)
 = s*s* cos(18°)
 ~ s*s* 0.9510565

in the direction of: <dx=0, dy=0, dz=1>

The direction of the outward pointing unit vector is: <dx=0, dy=0, dz=-1>


Vector perpendicular to face EFGOA:

 The cross product (OA x OG) is perpendicular to the second face.
 (OA x OG) = <xA, yA, zA> x <xG, yG, zG>
           = s*<cos(126°), sin(126°), 0> x s*<cos(phi), 0, sin(phi)>
           = <yA*zG - yG*zA, -xA*zG + xG*zA, xA*yG - xG*yA>
           = s*s* <sin(126°)*sin(phi), -cos(126°)*sin(phi), -cos(phi)*sin(126°)>
           = s*s* <sin( 54°)*sin(phi),  cos( 54°)*sin(phi), -cos(phi)*sin( 54°)>
           = s*s* <sin( 54°)*sin(phi),  cos( 54°)*sin(phi), -sin( 54°)*cos(phi)>

cos(phi) = cos(72°) / cos(54°) = sin(18°) / sin(36°) ~ 0.309017 / 0.587785 ~ 0.525731

phi ~ 58.2825° ~ 1.017222 rad

sin(phi) = sin(arccos(cos(72°) / cos(54°))) = sin(arccos(sin(18°) / sin(36°))) ~ 0.850651 = 0.5 / cos(54°) (AnswerMe: How does this happen?)

(OA x OG) = s*s* <sin( 54°)*sin(phi), cos( 54°)*sin(phi), -sin( 54°)*cos(phi)> ~ s*s* <0.809017 *0.850651, 0.587785 * 0.850651, -0.809017 *0.525731> ~ s*s* <0.688191, 0.5, -0.425325> = s*s* <tan( 54°) / 2, 1 / 2, -sin(18°)/tan(36°)>

which has a magnitude of: s*s* sqrt((0.688191)^2 + (0.5)^2 + (-0.425325)^2) = s*s* sqrt(0.9045085) = s*s* 0.9510565 = s*s* sin(72°) = s*s* cos(18°)

in the direction of: <dx~0.723607, dy~0.525731, dz~-0.447214> = <tan(54°)/2/cos(18°), 1/2/cos(18°), -tan(18°)/tan(36°)>

The outward pointing unit vector is: <dx~0.723607, dy~0.525731, dz~-0.447214>


Angle between faces

 The angle between the outward pointing unit vectors is the angle between the dodecahedron faces.

crow = arccos(<dx=0, dy=0, dz=-1> . <dx~0.723607, dy~0.525731, dz~-0.447214>) ~ arccos(0.447214) = arccos(tan(18°)/tan(36°)) ~ 63.435° ~ 1.10715 rad



When this example was originally posted, it had an erroneous answer of 61.95°.

The original solution did not take the square root when calculating the magnitudes of the cross product vectors. The resulting error was a factor of cos(18°) in the arccos' argument.

The cross product vectors themselves were calculated correctly. The magnitude of the cross product is the area of the parallelogram defined by the two vectors. The direction of the cross product is perpendicular to both vectors.


See also: AngleBetweenDodecahedronFaces, DotProduct, CrossProduct


EditText of this page (last edited September 4, 2006) or FindPage with title or text search