Skip to content

feat: Add atan2 support for value type Real - #3542

Closed
Stargazer10101 wants to merge 1 commit into
synfig:masterfrom
Stargazer10101:development7
Closed

Stargazer10101 wants to merge 1 commit into
synfig:masterfrom
Stargazer10101:development7

Conversation

@Stargazer10101

Copy link
Copy Markdown
Contributor

The value type "Real" doesn't have atan2 as a convert type. This PR introduces atan2 conversion of "Real" values, so that the Bone Angle → Real → Angle conversion can be achieved, as requested in the issue #3528 .
Fixes #3528

@github-actions

github-actions Bot commented Apr 2, 2025

Copy link
Copy Markdown

Thank you for contributing!
Below is how your contribution will appear in Synfig's release notes. Review it and improve your pull request's title and description so that your contribution is clear. You can add images, videos, and anything else you want. Have fun!

✨ New Features

  • Add atan2 support for value type Real

    The value type "Real" doesn't have atan2 as a convert type. This PR introduces atan2 conversion of "Real" values, so that the Bone Angle → Real → Angle conversion can be achieved, as requested in the issue #3528 .
    Fixes #3528

@rodolforg

Copy link
Copy Markdown
Contributor

The reason for real number can't be converted via atan2() is that atan2() is supposed to return an angle, as it means "arctangent" (i.e. arc/angle that gives such tangent).

You should do the Real -> Angle converter, but I still don't know what it is supposed to do with this conversion.

@Stargazer10101

Stargazer10101 commented Apr 10, 2025 •

Copy link
Copy Markdown
Contributor Author

I agree, Real → Angle doesn't make sense. But the user is trying to achieve this: Bone Angle → Real → Angle.
Right now, the converter atan2() can be connected to angle-valued parameters. But the user wants to convert "angle" to "real" first and then convert to atan2() .
When atan() is used on "Real" value type, it is treated as if it is a value of an angle in degrees. And then, the operations that are done are the same as when atan2() is used on "angle" value type.

@rodolforg

Copy link
Copy Markdown
Contributor

Original request/issue was solved via other PR #3560.
Thank you for your contribution ;)

@rodolforg rodolforg closed this May 15, 2025
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.

Converter real to angle

2 participants