Returns a vector with unit length that is orthogonal to this one.
| 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 { |
no test coverage detected