SilverScreen Solid Modeler

SS_COEF        

SS_COEF        

Previous topic Next topic  

SS_COEF        

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

SS_COEF

 

Structure

A data type used to represent a plane equation of the form: AX + BY + CZ + D = 0.

 

 

 struct SS_COEF

    {

    SS_XYZ abc;

    double d;

    } ;

 

 


Members

Member

Description

abc

A vector referred to as a plane normal. The x-member stores the A term from the equation above. The y-member stores the B term from the equation above. The z-member stores the C term from the equation above.

d

The d value of the plane equation.

 

 

Remarks

Given a point 'p' and a plane equation 'plane', here is how you can decide if the point is on the plane, on the + side, or on the - side. Note: There is a function which performs this calculation in the SilverScreen API called point_vs_plane and the code below is for informational purposes.

 

C / C++ Code

 

SS_XYZ  p;

SS_COEF plane;

double  tval;

 

tval = (plane.abc.x * p.x) + (plane.abc.y * p.y) + (plane.abc.z * p.z) +

       plane.d;

 

if ( zero_double(tval) )

  // The point is on the plane

else

if ( tval > 0.0 )

  // The point is on the + side of the plane

else
  // The point is on the - side of the plane

 

 

 

See Also

primitive_plane, primitive_plane2

 

Header

ssdef.h