index

Varkon MBS Programmers manual

# section_area - Function

## Description

Returns the area bounded by a planar curve. If the curve is not closed Varkon automatically closes the curve by inserting a straight line between its start and end positions. Accuracy is controlled by an optional parameter.

## Syntax

      a:=section_area(id, accuracy);

      float a;
      ref   id;
      float accuracy;

## Principal parameters

id | - Identity of curve or arc.

## Optional parameters

accuracy | - Maximum error relative to the curve arclength. Default is 0.005 = 0.5 %.

## Return value

A FLOAT value equal to the calculated area.

## Example

      a:=section_area(#4);

      ! Calculates the area for curve with ID = #4.
      ! Default numerical accuracy is used.

      a:=section_area(#4,0.001);

      ! Same as above but with higher accuracy.

## Comments

The area is computed by numerical integration. The number of calculations (iterations) is at least two. Smaller and smaller elements (triangles with one side equal to a short straight line, which approximates the curve) are used in each iteration and the calculation is ended when the error in the approximative arclength (the sum of the short straight lines) is less than the given accuracy, i.e. ( Total arclength - approximative arclength )/ ( Total arclength ) < accuracy.

The input curve must be a planar curve. The calculation is always made, but there will be a warning (with the maximum deviation from a plane) if the curve is non-planar. The criterion is 5 X Identical points criterion (default 0.01).

The maximum number of iterations is ten (10).

## See also

area()

Varkon version 1.19C svn# 120