Method IsCodirectional
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
IsCodirectional(GeoVector2, GeoVector2)
Determines whether two vectors point the same way, using the default tolerance.
public static bool IsCodirectional(GeoVector2 v1, GeoVector2 v2)
Parameters
v1GeoVector2The first vector.
v2GeoVector2The second vector.
Returns
- bool
true if the vectors are parallel and point the same way; otherwise, false.
IsCodirectional(GeoVector2, GeoVector2, Tolerance)
Determines whether two vectors point the same way, within a tolerance.
public static bool IsCodirectional(GeoVector2 v1, GeoVector2 v2, Tolerance tolerance)
Parameters
v1GeoVector2The first vector.
v2GeoVector2The second vector.
toleranceToleranceThe tolerance.
Returns
- bool
true if the vectors are parallel and point the same way; otherwise, false.
Remarks
Parallel is not enough: two vectors along one line point either the same way or opposite ways, and this tells those apart. A vector with no length is neither, as it has no direction to compare.