MCPcopy Create free account
hub / github.com/plotly/plotly.js / rotateBetween

Function rotateBetween

src/plots/geo/zoom.js:344–351  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

342}
343
344function rotateBetween(a, b) {
345 if(!a || !b) return;
346 var axis = cross(a, b);
347 var norm = Math.sqrt(dot(axis, axis));
348 var halfgamma = 0.5 * Math.acos(Math.max(-1, Math.min(1, dot(a, b))));
349 var k = Math.sin(halfgamma) / norm;
350 return norm && [Math.cos(halfgamma), axis[2] * k, -axis[1] * k, axis[0] * k];
351}
352
353// input:
354// rotateAngles: a calculated set of Euler angles

Callers 1

zoomClippedFunction · 0.85

Calls 2

crossFunction · 0.70
dotFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…