Unit 2D/3D• Unit[vector] returns a unit vector pointed in the direction of vector. • vector may be a simple vector or a Mech vector object with head Vector, Line, or Plane (3D). • Unit[bnum, lpnt] is interpreted as Unit[Vector[bnum, lpnt]]. • Other Unit[args, ... ] instances are interpreted as Unit[Line[args]]. • See also: Direction, Magnitude. Further Examples Load the Modeler2D package. Direction returns the direction vector of any Mech geometry object that has the property of having a direction.
Out[2]= | ![](/applications/mechsystems/FunctionIndex/HTMLImages/Unit.en/Unit.en_3.gif) |
Out[3]= | ![](/applications/mechsystems/FunctionIndex/HTMLImages/Unit.en/Unit.en_5.gif) |
Magnitude returns the length of the direction vector of a Mech vector object, taking advantage of some simplifications.
Out[4]= | ![](/applications/mechsystems/FunctionIndex/HTMLImages/Unit.en/Unit.en_7.gif) |
Similarly, Unit takes advantage of the fact that the magnitude of the vector is not a function of the coordinate system that the vector is expressed in. If the vector is already expressed in global coordinates, then such simplifications are not possible.
Out[5]= | ![](/applications/mechsystems/FunctionIndex/HTMLImages/Unit.en/Unit.en_9.gif) |
Out[6]= | ![](/applications/mechsystems/FunctionIndex/HTMLImages/Unit.en/Unit.en_11.gif) |
|