From b79cded56a6669d616b2012d1de6d4861ba570f8 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Tue, 9 Feb 2021 10:38:24 +0800 Subject: [PATCH] add spherical_coordinate --- src/experimental/note.md | 3 ++- src/spherical_coordinate.scad | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/spherical_coordinate.scad diff --git a/src/experimental/note.md b/src/experimental/note.md index 9f522d97..09985ed6 100644 --- a/src/experimental/note.md +++ b/src/experimental/note.md @@ -10,4 +10,5 @@ dotSCAD 3.0 Dev New modules/functions -- `some` \ No newline at end of file +- `spherical_coordinate` +- `util/some` diff --git a/src/spherical_coordinate.scad b/src/spherical_coordinate.scad new file mode 100644 index 00000000..295315d5 --- /dev/null +++ b/src/spherical_coordinate.scad @@ -0,0 +1,6 @@ +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]]; \ No newline at end of file