1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-01 04:20:27 +02:00
This commit is contained in:
Justin Lin
2021-02-09 14:30:44 +08:00
parent fa569028ab
commit e1e5ca3cdb

View File

@@ -1,6 +1,7 @@
use <__comm__/__angy_angz.scad>;
function spherical_coordinate(point) =
let(ayz = __angy_angz([0, 0, 0], point))
// mathematics, r, theta, phi
[norm(point), ayz[1], ayz[0]];
// mathematics [r, theta, phi]
[
norm(point),
atan2(point[1], point[0]),
atan2(point[2], sqrt(point[0]^2 + point[1]^2))
];