You are here: Start » AVL.NET » AVL.ShapeMoment(AvlNet.Path, AvlNet.ShapeMomentType, bool, float, float)
AVL.ShapeMoment(AvlNet.Path, AvlNet.ShapeMomentType, bool, float, float)
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void ShapeMoment( AvlNet.Path inShape, AvlNet.ShapeMomentType inMomentType, bool inCentral, out float outMoment, out float outNormMoment )
Parameters
- inShape
- Type: AvlNet.Path
- inMomentType
- Type: AvlNet.ShapeMomentType
- inCentral
- Type: System.Boolean
- outMoment
- Type: System.Single
- outNormMoment
- Type: System.Single
Description
The operation computes the mathematical features of a shape called moments. Those are integrals computed as follows:
\[ \begin{aligned} Moment_{2,0}(S) &= \int_{S} p_x^2 \\ Moment_{1,1}(S) &= \int_{S} p_x p_y \\ Moment_{0,2}(S) &= \int_{S} p_y^2 \end{aligned} \]The integration is conducted over shape surface, while \( p_x \) and \( p_y \) denote, accordingly, x and y coordinate of a point.
When inCentral parameter is set, the shape is shifted before computations so that its mass center is at location (0,0).
Note that if the input path is not a valid shape (i.e. it has at least one self-intersection), the computation may lead to results that are not intuitive.
Errors
| Error type | Description |
|---|---|
| DomainError | Open path on input in ShapeMoment. |
| DomainError | Not supported moment type in ShapeMoment. |
