MCPcopy Create free account
hub / github.com/MyGUI/mygui / getOrthonormal

Method getOrthonormal

MyGUIEngine/src/msdfgen/core/Vector2.hpp:54–58  ·  view source on GitHub ↗

Returns a vector with unit length that is orthogonal to this one.

Source from the content-addressed store, hash-verified

52
53 /// Returns a vector with unit length that is orthogonal to this one.
54 inline Vector2 getOrthonormal(bool polarity = true, bool allowZero = false) const {
55 if (double len = length())
56 return polarity ? Vector2(-y/len, x/len) : Vector2(y/len, -x/len);
57 return polarity ? Vector2(0, !allowZero) : Vector2(0, -!allowZero);
58 }
59
60#ifdef MSDFGEN_USE_CPP11
61 inline explicit operator bool() const {

Callers 1

signedDistanceMethod · 0.80

Calls 2

Vector2Class · 0.85
lengthFunction · 0.50

Tested by

no test coverage detected