MCPcopy
hub / github.com/EngoEngine/engo / PointDistanceSquared

Method PointDistanceSquared

math.go:133–135  ·  view source on GitHub ↗

PointDistanceSquared returns the squared euclidean distance between p and p2

(p2 Point)

Source from the content-addressed store, hash-verified

131
132// PointDistanceSquared returns the squared euclidean distance between p and p2
133func (p *Point) PointDistanceSquared(p2 Point) float32 {
134 return (p.X-p2.X)*(p.X-p2.X) + (p.Y-p2.Y)*(p.Y-p2.Y)
135}
136
137// ProjectOnto returns the vector produced by projecting p on to p2
138// returns an empty Point if they can't project onto one another

Callers 1

PointDistanceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected