Previous section-----Next section

3.1.2 Output Functions

Modeler2D numerical output functions return expressions that evaluate to numbers or vectors, such as the distance between two points, the angle between two lines, or the coordinates of a point. These functions take point, vector, and axis objects as arguments, identical in structure to the geometry objects used when building constraints. When local point numbers are used, the local coordinates are taken from the current body objects, as specified with SetBodies.
Each of the output functions are demonstrated in the context of the quick-return mechanism model defined in Section 3.1.1.

Output functions.

More complex output functions.

The Location function is used to convert a Mech Point object into the global coordinates of the point.

Here are the global coordinates of point 2 on the drive arm.

Location assumes a point object if only the arguments of Point are given.

In[20]:=
Out[20]=

This gets a numerical result from the output of Location.

The Distance function is used to find the absolute distance between any two points in space. The points can be on one body or on two different bodies.

Here is the distance from the center of the crank to point 2 on the slider.

Here is the numerical result.

Here is the length of the line from the center of the crank to the drive pin.

Note that it was not necessary to apply a solution rule to the last example to get a numerical result because the dimension being measured is not a function of the coordinates of each body.

Here is the minimum distance between the crank axis and the center line of the drive arm.

Now get a numerical result.

Note that the distance is zero when the crank has turned 1/4 turn, and the drive arm is pointed straight up, through the axis of the crank.

Here is the direction angle of the center line of the connecting rod.

Now get a numerical result in degrees.

The Rotation function simply returns the angular coordinate of the specified body.

Here is theta of the drive arm.

This returns the intersection of the connecting rod axis and a vertical line through the crank axis.

The ProjectOnLine function is used to find the projection of a point on one body onto a line located on another body (or bodies).

This projects the crank's drive pin onto the connecting rod.