|
||
bool SetMagnitude(double desired_magnitude);
double desired_magnitude; // A double-precision floating point value
|
|
|||
Synopsis |
using SilverSharp;
The SetMagnitude method moves the 3D point along a directed vector through the origin such that its' magnitude becomes desired_magnitude
|
|
||
Parameters |
desired_magnitude is the length of the line formed between the origin and the new 3D point.
|
|
||
Return Value |
SetMagnitude returns true if the desired magnitude can be established, and false otherwise. If the original 3D point is equal to the origin, then an infinite number of direction vectors is described and the magnitude becomes meaningless unless it is zero.
|
|
||
Remarks |
If SetMagnitude succeeds, then the new point will reside on the same line that is formed between the origin and the original point.
|
|
||
See Also |
|
|
||
Example |
The following code will create a point, p3, that is 5 units from p1 along the line formed between p1 and p2:
Note: The SilverScreen API routine follow_vector can perform the above calculations more easily. |
|