Get the length squared. For performance, use this instead of b2Vec2::Length (if possible).
()
| 110 | /// Get the length squared. For performance, use this instead of |
| 111 | /// b2Vec2::Length (if possible). |
| 112 | func (v B2Vec2) LengthSquared() float64 { |
| 113 | return v.X*v.X + v.Y*v.Y |
| 114 | } |
| 115 | |
| 116 | /// Convert this vector into a unit vector. Returns the length. |
| 117 | func (v *B2Vec2) Normalize() float64 { |
no outgoing calls
no test coverage detected