1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-01 04:20:27 +02:00

fix wrong phi

This commit is contained in:
Justin Lin
2021-02-14 19:53:02 +08:00
parent db608d9ec9
commit a735ab0365
2 changed files with 2 additions and 2 deletions

View File

@@ -16,4 +16,4 @@ Converts from Cartesian to Spherical coordinates (used in mathematics). It retur
r = round(coord[0]);
theta = round(coord[1]);
phi = round(coord[2]);
assert([r, theta, phi] == [173, 45, 35]);
assert([r, theta, phi] == [173, 45, 55]);

View File

@@ -13,5 +13,5 @@ function spherical_coordinate(point) =
[
norm(point),
atan2(point[1], point[0]),
atan2(point[2], sqrt(point[0]^2 + point[1]^2))
atan2(sqrt(point[0]^2 + point[1]^2), point[2])
];