MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / rotate

Function rotate

chapter24/docs/d3-graphviz.js:1424–1433  ·  view source on GitHub ↗
(x, y, cosA, sinA)

Source from the content-addressed store, hash-verified

1422 }
1423
1424 function rotate(x, y, cosA, sinA) {
1425 // (x + j * y) * (cosA + j * sinA) = x * cosA - y * sinA + j * (x * sinA + y * cosA)
1426 y = -y;
1427 sinA = -sinA;
1428 var _ref = [x * cosA - y * sinA, x * sinA + y * cosA];
1429 x = _ref[0];
1430 y = _ref[1];
1431 y = -y;
1432 return [x, y];
1433 }
1434
1435 function drawEdge(x1, y1, x2, y2, attributes) {
1436 var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};

Callers 1

_moveEdgeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected