1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-21 06:31:51 +02:00

return [0, 0] if [0, 0]

This commit is contained in:
Justin Lin 2022-05-09 16:20:48 +08:00
parent 969595b4c8
commit 8a9011422a

View File

@ -8,4 +8,4 @@
*
**/
function polar_coordinate(point) = [norm(point), atan2(point.y, point.x)]; // r, theta
function polar_coordinate(point) = point == [0, 0] ? point : [norm(point), atan2(point.y, point.x)]; // r, theta