Back to Adaptive Vision Library website
You are here: Start » Function Reference » Geometry 2D Angle Metrics » AngleBetweenVectors
AngleBetweenVectors
Measures the angle between two vectors.
Header: | AVL.h |
---|
Syntax
C++
C#
void avl::AngleBetweenVectors ( const avl::Vector2D& inVector1, const avl::Vector2D& inVector2, atl::Optional<avl::RotationDirection::Type> inRotationDirection, atl::Optional<float&> outAbsoluteAngle = atl::NIL, atl::Optional<float&> outDirectedAngle = atl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inVector1 | const Vector2D& | Start vector | ||
inVector2 | const Vector2D& | Target vector | ||
inRotationDirection | Optional<RotationDirection::Type> | NIL | Clockwise, counter-clockwise or automatic (by smaller angle) | |
outAbsoluteAngle | Optional<float&> | NIL | Angle value used for measurements <0; 360> | |
outDirectedAngle | Optional<float&> | NIL | Angle 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.