MCPcopy Create free account
hub / github.com/crawl/crawl / _normalize

Function _normalize

crawl-ref/source/mon-project.cc:230–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230static void _normalize(float &x, float &y)
231{
232 const float d = sqrt(x*x + y*y);
233 if (d <= 0.000001)
234 return;
235 x/=d;
236 y/=d;
237}
238
239// angle measured in chord length
240static bool _in_front(float vx, float vy, float dx, float dy, float angle)

Callers 2

_fuzz_directionFunction · 0.70
iood_actFunction · 0.70

Calls 1

sqrtFunction · 0.85

Tested by

no test coverage detected