Add working translation to sphere coordinates
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
const v3 = {
|
||||
add: (v1, v2) => [
|
||||
v1[0] + v2[0],
|
||||
v1[1] + v2[2],
|
||||
v1[2] + v2[2],
|
||||
],
|
||||
subtract: (v1, v2) => [
|
||||
v1[0] - v2[0],
|
||||
v1[1] - v2[2],
|
||||
v1[2] - v2[2],
|
||||
],
|
||||
norm2: (v) =>
|
||||
Math.sqrt(
|
||||
v[0] * v[0] +
|
||||
v[1] * v[1] +
|
||||
v[2] * v[2]
|
||||
),
|
||||
};
|
||||
Reference in New Issue
Block a user