MCPcopy Create free account
hub / github.com/ByteArena/box2d / LengthSquared

Method LengthSquared

CommonB2Math.go:112–114  ·  view source on GitHub ↗

Get the length squared. For performance, use this instead of b2Vec2::Length (if possible).

()

Source from the content-addressed store, hash-verified

110/// Get the length squared. For performance, use this instead of
111/// b2Vec2::Length (if possible).
112func (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.
117func (v *B2Vec2) Normalize() float64 {

Callers 7

B2DistanceFunction · 0.80
SolveC3Method · 0.80
SetMethod · 0.80
RayCastMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected