Files
lan-manager/web/node_modules/gl-vec2/rotate.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

23 lines
416 B
JavaScript

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
}