﻿ A simple formula example

# A Simple Formula Example

by Reinhard Siegel

MultiSurf provides a wide variety of mathematical functions. The complete set of functions is listed below.

Often used functions are the following ones:

• XPOS, YPOS, ZPOS: returns the XYZ position of a point
• TPOS returns the t position of a point
• ARCLEN: return the girth length between two curve points
• AREA: returns the area of a surface
• CENTROID: returns the XYZ coordinates of center of area

Let us consider a simple example. Open model wl_length.ms2. #### Model wl_length.ms2

The model shows hull surface "hull". We want to measure the waterline length.

• Create Magnet "id_hull" in the bow area.
• Intersect the hull by the *Z=0 plane. This is the Intersection Snake "n_wl".
• Put ring1 at the start of the intersection snake.
• Put ring2 at the end of the intersection snake.
• Create the Formula "wl_length" using this expression: Here the function DIST has been used.

Since both rings have coordinates Y = 0 and Z = 0 an alternative is to use the function XPOS. The expression for the formula "wl_length" would then read: XPOS(ring2) - XPOS(ring1).

In order to display the result of our calculation (i. e. the value of variables and formulas) we have two options:

• Real Values
• Text Label

For Real Values display use the Tools menu or the shortcut letter key V.

To present the content of variables by the entity Text Label follow thes steps.

• Create a point serving as the handle of the Text Label (here this is point pt1)
• Insert the Text Label entity. Note, that the property "Legend" provides input for a discription as well as for the formating of the displayed value. More complex use of variables and formulas is made in the models sloop_rig.ms2, J22.ms2 and main_dimensions.ms2.