You are here: Start » FIL.NET » Function Reference » Geometry 2D » Geometry 2D Angle Metrics » FIL.AngleBetweenVectors

FIL.AngleBetweenVectors

Measures the angle between two vectors.

Namespace:FilNet
Assembly:FIL.NET.dll

Syntax

C++
C#
 
public static void AngleBetweenVectors
(
	FilNet.Vector2D inVector1,
	FilNet.Vector2D inVector2,
	FilNet.RotationDirection? inRotationDirection,
	out float outAbsoluteAngle,
	out float outDirectedAngle
)

Parameters

Name Type Range Default Description
inVector1FilNet.Vector2DStart vector.
inVector2FilNet.Vector2DTarget vector.
inRotationDirectionFilNet.RotationDirection?Clockwise, counter-clockwise or automatic (by smaller angle). Default value: ftl::NIL.
outAbsoluteAnglefloatAngle value used for measurements <0; 360>
outDirectedAnglefloatAngle value used for clockwise transformations <-360; 360>

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.

Function Overrides

See also