|
||
double GetMagnitudeSquared();
|
|
|||
Synopsis |
using SilverSharp;
The GetMagnitudeSquared method measures the squared distance from the w-space origin (0,0,0) to the 3D point stored in the SilverSharp.SS_XYZ object. Often the squared distance is useful in sorting as a way to avoid calculating a square root. |
|
||
Parameters |
none |
|
||
Return Value |
GetMagnitudeSquared returns the squared distance of the 3D point from the origin. |
|
||
Remarks |
Given an x, y, and z-coordinate the squared magnitude is computed as follows:
(x * x) + (y * y) + (z * z);
|
|
||
See Also |
|
|||
Example |
The following code measures the squared magnitude of the 3D vector 5,0,0:
|
|