Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
vec2.angle = function (v1, v2) {
const theta = vec2.dot(v1, v2) / (vec2.length(v1) * vec2.length(v2));
return Math.acos(clamp(theta, -1, 1));
};