MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Magnitude

Method Magnitude

utils.go:205–207  ·  view source on GitHub ↗

Magnitude returns the length of the Point.

()

Source from the content-addressed store, hash-verified

203
204// Magnitude returns the length of the Point.
205func (point Vector) Magnitude() float32 {
206 return float32(math.Sqrt(float64(point.X*point.X + point.Y*point.Y)))
207}
208
209func (point Vector) Scale(scalar float32) Vector {
210 point.X *= scalar

Callers 2

UnitMethod · 0.95
UpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected