Table of Contents

Method GetPerpendicularVector

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

GetPerpendicularVector()

Gets an arbitrary unit vector perpendicular to this one.

public GeoVector3 GetPerpendicularVector()

Returns

GeoVector3

A unit vector perpendicular to this vector.

Remarks

In 3D a vector has a whole plane of perpendiculars and no way to prefer one, so which of them comes back is unspecified beyond being perpendicular and of unit length. It is stable for a given input. The axis crossed against is the one this vector leans on least, which keeps the cross product well away from zero and the result well conditioned.

Exceptions

InvalidOperationException

Thrown when the vector has zero length.