Previous section-----Next section

3.2.3 Vector Algebra Functions

Modeler3D vector algebra functions perform many common vector algebra operations, such as cross and dot products of vectors. These functions can be used to build more complicated functions that are not provided by Modeler3D. These functions take point, vector, and axis objects as arguments, just like the output functions described in Section 3.2.2. When local point numbers are used, the local coordinates are taken from the current body objects, as specified with SetBodies.
Each of the vector algebra functions is demonstrated in the context of the slider-crank mechanism model defined at the beginning of this section.

Vector algebra functions.

The Direction function is used to convert Modeler3D vector objects into 3D vectors in global coordinates.

Here is the direction vector of the connecting rod.

Now get a numerical result.

Several Modeler3D output functions are textbook vector algebra functions that are capable of dealing with normal 3D vectors or Modeler3D vector/axis objects interchangeably.

Magnitude can return the length of the line from one end of the connecting rod to the other.

Here is the length of a simple 3D vector.

Unit also works with vectors or vector objects.

The cross product of two vectors is found with the Cross function.

Here is the cross product of a Modeler3D Line object and a vector.

In[36]:=
Out[36]=

Now get a numerical result.

Here is the 3D rotation matrix associated with the crank.

Here is the skew symmetric matrix operator.

The global coordinates of a point specified in a local reference frame are equal to the coordinates of the origin of the reference frame plus the local coordinates of the point, rotated into the global reference frame.

Here is a calculation of the global coordinates of the local point {3, 8} on the slider.

The Location function performs effectively the same calculation.

The PointToLocal function converts the global point back to local coordinates.

A constant utility.

Coordinate Conversions

The following four conversion functions will not accept Modeler3D geometry objects as arguments. These functions only accept 3D vectors of the form {x, y, z}.

Coordinate conversions.

Coordinate conversion options.

This converts a cylindrical coordinate triplet to Cartesian coordinates.

This converts it back.

This converts a 3D vector to polar coordinates.