javascript(ultra32): added rotate
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
edd15321fa
commit
2ecbd6d4b4
2 changed files with 10 additions and 61 deletions
javascript/ultra32
|
@ -35,3 +35,10 @@ function mirror(vector) {
|
|||
return vector;
|
||||
}
|
||||
exports.mirror = mirror;
|
||||
function rotate(vector) {
|
||||
const oldx = vector[0];
|
||||
vector[0] = Math.cos(vector[0]) - Math.sin(vector[1]);
|
||||
vector[1] = Math.sin(oldx) + Math.cos(vector[1]);
|
||||
return vector;
|
||||
}
|
||||
exports.rotate = rotate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue