* 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)
| 24805 | * @returns {Number} The angle in radians |
| 24806 | */ |
| 24807 | function 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 | /***/ }), |
nothing calls this directly
no test coverage detected
searching dependent graphs…