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

Method mag2

olcPixelGameEngine.h:665–668  ·  view source on GitHub ↗

Returns magnitude squared of vector (useful for fast comparisons)

Source from the content-addressed store, hash-verified

663
664 // Returns magnitude squared of vector (useful for fast comparisons)
665 inline constexpr T mag2() const
666 {
667 return x * x + y * y;
668 }
669
670 // Returns normalised version of vector
671 inline v_2d norm() const

Callers 2

UpdateMethod · 0.45
UpdateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected