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

Method Normalized

utils.go:177–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175}
176
177func (point Vector) Normalized() Vector {
178 dist := point.Distance(Vector{0, 0})
179 return Vector{point.X / dist, point.Y / dist}
180}
181
182func (point Vector) Rounded() Vector {
183 return Vector{float32(math.Round(float64(point.X))), float32(math.Round(float64(point.Y)))}

Callers 4

UpdateMethod · 0.80
DrawMethod · 0.80
UpdateMethod · 0.80
DrawMethod · 0.80

Calls 1

DistanceMethod · 0.95

Tested by

no test coverage detected