Skip to content

Fix misleading docstring in cartesian_to_spherical - #4764

Merged
behackl merged 3 commits into
ManimCommunity:mainfrom
changsheng0804-blip:fix-cartesian-to-spherical-docstring
Aug 1, 2026
Merged

Fix misleading docstring in cartesian_to_spherical#4764
behackl merged 3 commits into
ManimCommunity:mainfrom
changsheng0804-blip:fix-cartesian-to-spherical-docstring

Conversation

@changsheng0804-blip

Copy link
Copy Markdown
Contributor

Summary

Fixes #3123

The docstring for \cartesian_to_spherical\ stated the return order as (distance, phi, theta), but the actual return value is [r, theta, phi]. This PR updates the docstrings of both \cartesian_to_spherical\ and \spherical_to_cartesian\ to:

  1. Correctly state the return order as [r, theta, phi]\
  2. Clearly define each component:

    • \ — radius (distance from the origin)
    • \ heta\ — azimuthal angle (in the xy-plane from the positive x-axis)
    • \phi\ — polar angle (from the positive z-axis)

No code logic was changed — this is a documentation-only fix.

References

changsheng0804-blip and others added 2 commits June 3, 2026 09:48
…ity#3123)

The docstring for cartesian_to_spherical stated the return order as
(distance, phi, theta) but the actual return was [r, theta, phi].

This updates both cartesian_to_spherical and spherical_to_cartesian
docstrings to clearly document the return order as (r, theta, phi)
and define each component: r = radius, theta = azimuthal angle in
the xy-plane, phi = polar angle from the positive z-axis.

@behackl behackl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the long wait, thanks for your contribution; much appreciated!

@behackl behackl added the documentation Improvements or additions to documentation label Aug 1, 2026
@behackl
behackl merged commit d413952 into ManimCommunity:main Aug 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing/Misleading docstring for cartesian_to_spherical

2 participants