Skip to content

Fix docstring for cartesian_to_spherical to match return order#4823

Open
daudibrahimhasan wants to merge 2 commits into
ManimCommunity:mainfrom
daudibrahimhasan:patch-1
Open

Fix docstring for cartesian_to_spherical to match return order#4823
daudibrahimhasan wants to merge 2 commits into
ManimCommunity:mainfrom
daudibrahimhasan:patch-1

Conversation

@daudibrahimhasan

Copy link
Copy Markdown

Overview: What does this pull request change?

Fixes the misleading docstring for cartesian_to_spherical in manim/utils/space_ops.py.

The docstring stated the return value as (distance, phi, theta), but the function actually returns [r, theta, phi]. This updates the docstring to match the implementation and adds a Returns section describing each value,
consistent with the documentation of spherical_to_cartesian.

Closes #3123

Motivation and Explanation: Why and how do your changes improve the library?

The previous docstring listed the coordinates in the wrong order, which is confusing for anyone using the function
(the issue reporter ran into exactly this). Correcting it — and documenting what each returned value means — removes
the inconsistency and makes the function's behaviour clear without needing to read the source.

Links to added or changed documentation pages

N/A — this is an in-code docstring fix only.

Further Information and Comments

Documentation-only change; no functional code was modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing/Misleading docstring for cartesian_to_spherical

1 participant