SilverScreen Solid Modeler

cross_product

cross_product

Previous topic Next topic  

cross_product

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

void cross_product ( SS_XYZ *xyz1, SS_XYZ *xyz2, SS_XYZ *xyz3, SS_XYZ *cross )

 

SS_XYZ *xyz1;        // a pointer to a 3D point

SS_XYZ *xyz2;        // a pointer to a 3D point

SS_XYZ *xyz3;        // a pointer to a 3D point

SS_XYZ *cross;       // the result, a pointer to a 3D point

 

 




Synopsis

#include "silver.h"

 

The cross_product function computes the cross-product of the three points at xyz1 , xyz2 and xyz3 . The cross-product is computed by the following calculation:

 

C / C++ Code

 

 cross->x = xyz1->y * (xyz2->z - xyz3->z) +

            xyz2->y * (xyz3->z - xyz1->z) +

            xyz3->y * (xyz1->z - xyz2->z);

 

 cross->y = xyz1->z * (xyz2->x - xyz3->x) +

            xyz2->z * (xyz3->x - xyz1->x) +

            xyz3->z * (xyz1->x - xyz2->x);

 

 cross->z = xyz1->x * (xyz2->y - xyz3->y) +

            xyz2->x * (xyz3->y - xyz1->y) +

            xyz3->x * (xyz1->y - xyz2->y);

 

 

 

Parameters

xyz1 , xyz2 , xyz3 and cross are all pointers to SS_XYZ structures.

 

 

Return Value

none; the result is stored into cross .

 

 

See Also

dot_product