module.exports = rotate /** * Rotates a vec2 by an angle * * @param {vec2} out the receiving vector * @param {vec2} a the vector to rotate * @param {Number} angle the angle of rotation (in radians) * @returns {vec2} out */ function rotate(out, a, angle) { var c = Math.cos(angle), s = Math.sin(angle) var x = a[0], y = a[1] out[0] = x * c - y * s out[1] = x * s + y * c return out }