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 distance from the w-space origin (0,0,0) to the 3D point stored in the SilverSharp.SS_XYZ object.

 

 

Parameters

none

 

 

Return Value

GetMagnitude returns the distance of the 3D point from the origin.

 

 

Remarks

Given an x, y, and z-coordinate the magnitude is computed as follows:

 

  sqrt( (x * x) + (y * y) + (z * z) );

 

 

See Also

SS_XYZ

 

 

Example

The following code measures the magnitude of the 3D vector 5,0,0:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 SS_XYZ pt = new SS_XYZ(5.0, 0.0,  0.0);

 double val;

 

 val = pt.GetMagnitude(); // = sqrt(5*5 + 0*0 + 0*0)

 

 p1.Clear();