You are here: Start » AVL.NET » AVL.AngleBetweenVectors(AvlNet.Vector2D, AvlNet.Vector2D, AvlNet.RotationDirection?, float, float)
AVL.AngleBetweenVectors(AvlNet.Vector2D, AvlNet.Vector2D, AvlNet.RotationDirection?, float, float)
Measures the angle between two vectors.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void AngleBetweenVectors( AvlNet.Vector2D inVector1, AvlNet.Vector2D inVector2, AvlNet.RotationDirection? inRotationDirection, out float outAbsoluteAngle, out float outDirectedAngle )
Parameters
- inVector1
- Type: AvlNet.Vector2D
Start vector - inVector2
- Type: AvlNet.Vector2D
Target vector - inRotationDirection
- Type: System.Nullable<AvlNet.RotationDirection>
Clockwise, counter-clockwise or automatic (by smaller angle), or null. - outAbsoluteAngle
- Type: System.Single
- outDirectedAngle
- Type: System.Single
Description
Note that because of inaccuracies of floating-point arithmetic, some geometric operations (including this one) may lead to unpredictable results for degenerated cases. In this filter such a case occurs when a zero vector is given on input.
Examples
![]() |
AngleBetweenVectors performed on two vectors: inVector1 DeltaX = 10, DeltaY = 10, inVector2 DeltaX = -5, DeltaY = 5, inRotationDirection = CounterClockwise.
outAbsoluteAngle returns 270, and outDirectedAngle returns -270.

