PointDistanceSquared returns the squared euclidean distance between p and p2
(p2 Point)
| 131 | |
| 132 | // PointDistanceSquared returns the squared euclidean distance between p and p2 |
| 133 | func (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 |