SilverScreen Solid Modeler

GetMagnitude method

GetMagnitude method

Previous topic Next topic  

GetMagnitude method

Previous topic Next topic JavaScript is required for the print function  

 

SilverSharpAPI

 

double GetMagnitude();

 

 

 

 

 




Synopsis

using SilverSharp;

 

The GetMagnitude method measures the length of the plane direction vector

 

 

Parameters

none

 

 

Return Value

GetMagnitude returns the length of the direction vector specified by the A, B, and C components of the plane equation.

 

 

Remarks

Given an A, B, and C component the magnitude is computed as follows:

 

   sqrt( (A * A) + (B * B) + (C * C) );

 

 

See Also

SS_COEF

 

Example

The following code measures the length of the a plane's direction vector and uses it to normalize the plane equation:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 SS_COEF coef = new SS_COEF(0.0, 10.0,  0.0, 0.0);

 double val;

 

 val = coef.GetMagnitude(); // = 10.0

 

 coef /= val;  // GetMagnitude will become 1