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

Method DistanceSquared

utils.go:155–157  ·  view source on GitHub ↗
(other Vector)

Source from the content-addressed store, hash-verified

153}
154
155func (point Vector) DistanceSquared(other Vector) float32 {
156 return float32(math.Pow(float64(other.X-point.X), 2) + math.Pow(float64(other.Y-point.Y), 2))
157}
158
159func (point Vector) Distance(other Vector) float32 {
160 return float32(math.Sqrt(float64(point.DistanceSquared(other))))

Callers 3

DistanceMethod · 0.95
UpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected