MCPcopy Create free account
hub / github.com/aosabook/500lines / vectorAtPoint

Function vectorAtPoint

blockcode/code/gamelib/game.js:27–34  ·  view source on GitHub ↗
(x,y)

Source from the content-addressed store, hash-verified

25 }
26
27 function vectorAtPoint(x,y){
28 return {
29 x: x,
30 y: y,
31 mag: sqrt(x*x + y*y),
32 rad: atan2(y,x)
33 };
34 }
35
36 // convert degrees to radians
37 function deg2rad(deg){

Callers 6

onResizeFunction · 0.85
wrapFunction · 0.85
bounceFunction · 0.85
limitFunction · 0.85
moveToXFunction · 0.85
moveToYFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected