MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / norm

Method norm

olcPixelGameEngine.h:671–675  ·  view source on GitHub ↗

Returns normalised version of vector

Source from the content-addressed store, hash-verified

669
670 // Returns normalised version of vector
671 inline v_2d norm() const
672 {
673 auto r = 1 / mag();
674 return v_2d(x * r, y * r);
675 }
676
677 // Returns vector at 90 degrees to this one
678 inline constexpr v_2d perp() const

Callers 2

UpdateMethod · 0.45
OnUserUpdateMethod · 0.45

Calls 1

v_2dClass · 0.70

Tested by 1

OnUserUpdateMethod · 0.36