Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenEndedGroup/Field2
/ safeNormalize
Function
safeNormalize
src/main/java/trace/simulation/Boids.kt:112–118 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
110
}
111
112
private fun Vec2.safeNormalize(): Vec2 {
113
114
while (this.length() == 0.0)
115
this.noise(1.0f).safeNormalize()
116
return this.normalize()
117
118
}
Callers
nothing calls this directly
Calls
3
length
Method · 0.45
noise
Method · 0.45
normalize
Method · 0.45
Tested by
no test coverage detected