mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-09-01 10:42:57 +02:00
add spherical_coordinate
This commit is contained in:
19
docs/lib3x-spherical_coordinate.md
Normal file
19
docs/lib3x-spherical_coordinate.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# spherical_coordinate
|
||||
|
||||
Converts from Cartesian to Polar coordinates. It returns `[radius, theta, phi]`.
|
||||
|
||||
**Since:** 3.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `point` : The Cartesian coordinates of a point.
|
||||
|
||||
## Examples
|
||||
|
||||
use <util/spherical_coordinate.scad>;
|
||||
|
||||
coord = spherical_coordinate([100, 100, 100]);
|
||||
r = round(coord[0]);
|
||||
theta = round(coord[1]);
|
||||
phi = round(coord[2]);
|
||||
assert([r, theta, phi] == [173, 45, 35]);
|
Reference in New Issue
Block a user