angle function
Get the angle between two 3D vectors @param {ReadonlyVec3} a The first operand @param {ReadonlyVec3} b The second operand @returns {Number} The angle in radians
Implementation
double angle(List<double> a, List<double> b) {
final ax = a[0],
ay = a[1],
az = a[2],
bx = b[0],
by = b[1],
bz = b[2],
mag = math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)),
cosine = mag == 0 ? 0 : dot(a, b) / mag;
return math.acos(math.min(math.max(cosine, -1), 1));
}