MCPcopy Index your code
hub / github.com/plotly/plotly.js / angle

Function angle

stackgl_modules/index.js:24807–24821  ·  view source on GitHub ↗

* Get the angle between two 3D vectors * @param {vec3} a The first operand * @param {vec3} b The second operand * @returns {Number} The angle in radians

(a, b)

Source from the content-addressed store, hash-verified

24805 * @returns {Number} The angle in radians
24806 */
24807function angle(a, b) {
24808 var tempA = fromValues(a[0], a[1], a[2])
24809 var tempB = fromValues(b[0], b[1], b[2])
24810
24811 normalize(tempA, tempA)
24812 normalize(tempB, tempB)
24813
24814 var cosine = dot(tempA, tempB)
24815
24816 if(cosine > 1.0){
24817 return 0
24818 } else {
24819 return Math.acos(cosine)
24820 }
24821}
24822
24823
24824/***/ }),

Callers

nothing calls this directly

Calls 3

fromValuesFunction · 0.85
normalizeFunction · 0.85
dotFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…