Skip to content

Fix misleading docstring in cartesian_to_spherical#4764

Open
changsheng0804-blip wants to merge 1 commit into
ManimCommunity:mainfrom
changsheng0804-blip:fix-cartesian-to-spherical-docstring
Open

Fix misleading docstring in cartesian_to_spherical#4764
changsheng0804-blip wants to merge 1 commit into
ManimCommunity:mainfrom
changsheng0804-blip:fix-cartesian-to-spherical-docstring

Conversation

@changsheng0804-blip

Copy link
Copy Markdown

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

…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.
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