1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-spherical_coordinate.md

19 lines
440 B
Markdown
Raw Normal View History

2021-02-13 11:00:09 +08:00
# spherical_coordinate
2021-02-13 11:03:02 +08:00
Converts from Cartesian to Spherical coordinates (used in mathematics). It returns `[radius, theta, phi]`.
2021-02-13 11:00:09 +08:00
**Since:** 3.0
## Parameters
- `point` : The Cartesian coordinates of a point.
## Examples
2022-06-06 13:11:46 +08:00
use <util/spherical_coordinate.scad>
2021-02-13 11:00:09 +08:00
coord = spherical_coordinate([100, 100, 100]);
r = round(coord[0]);
theta = round(coord[1]);
phi = round(coord[2]);
2021-02-14 19:53:02 +08:00
assert([r, theta, phi] == [173, 45, 55]);