MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / rotate

Function rotate

libraries/p5.js:30055–30059  ·  view source on GitHub ↗
(x, y, rad)

Source from the content-addressed store, hash-verified

30053 var PI = Math.PI, _120 = PI * 120 / 180, f1, f2, cx, cy,
30054 rad = PI / 180 * (+angle || 0), res = [], xy,
30055 rotate = function (x, y, rad) {
30056 var X = x * Math.cos(rad) - y * Math.sin(rad),
30057 Y = x * Math.sin(rad) + y * Math.cos(rad);
30058 return { x: X, y: Y };
30059 };
30060 if (!recursive) {
30061 xy = rotate(x1, y1, -rad);
30062 x1 = xy.x;

Callers 1

a2cFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected