Skip to content

Converter real to angle #3528

Closed
Closed

Description

@zaynopenapp

When my calculation requires a real value, I normally connect it by converting an angle to a real number. However, the problem is that the angle comes from a formula—for example, the result of atan2, which is an angle. I hope the value can be converted into a real number so that my calculation works properly.

Image

Activity

  1. BobSynfig commented on Mar 21, 2025

    @BobSynfig
    Collaborator

    Aren’t Convert and Export combined sufficient to do what you need?

    Image

  2. Stargazer10101 commented on Mar 21, 2025

    @Stargazer10101
    Contributor

    I observed that the atan2 converter cannot be applied once the real converter is applied to a parameter. But I'm not sure if this is what @zaynopenapp is trying to point out.

  3. BobSynfig commented on Mar 21, 2025

    @BobSynfig
    Collaborator

    I observed that the atan2 converter cannot be applied once the real converter is applied to a parameter.

    https://wiki.synfig.org/Convert#aTan2

    aTan2
    Converting an angle-valued parameter to "aTan2" adds two sub-parameters:

    real "X"
    real "Y".
    The resulting value is: atan2(y,x)
    ie. atan(y/x) but without an error when x is 0. The value is the angle between the x axis and the vector (x,y).

  4. Stargazer10101 commented on Mar 21, 2025

    @Stargazer10101
    Contributor

    Alright got it!

  5. zaynopenapp commented on Mar 22, 2025

    @zaynopenapp
    Author

    Thank for your respons. Actualy this converter opposite from angle to real. Something like real to angle. That mean from angle i get real value. And then convert again to angle. Why because my formula is for sample atan2 the result is angle value. So i can not connect to other formula, meanwhile my formula need real value. Not angle (from atan2)

    If this still compusing, i will explain more detail next

  6. rodolforg commented on Mar 22, 2025

    @rodolforg
    Contributor

    Please write the math equation you want to do :)

  7. Svarov-RZM commented on Mar 22, 2025

    @Svarov-RZM
    Contributor

    Please write the math equation you want to do :)

    The guy's pretty bad at English, not gonna lie, very hard to understand...
    But it's fine, none of us are native English speakers either ;)

    I think he just wants an "Angle" converter for the real type. Currently we have ValueNode_Real that takes an angle and translates it into a real type. The guy wants the opposite, a converter that takes real type and translates it into angle type. Which I'd say a reasonable request.

  8. zaynopenapp commented on Mar 24, 2025

    @zaynopenapp
    Author

    Please write the math equation you want to do :)

    The guy's pretty bad at English, not gonna lie, very hard to understand... But it's fine, none of us are native English speakers either ;)

    I think he just wants an "Angle" converter for the real type. Currently we have ValueNode_Real that takes an angle and translates it into a real type. The guy wants the opposite, a converter that takes real type and translates it into angle type. Which I'd say a reasonable request.

    Thanks you. Sorry my english is bad..

  9. rodolforg commented on Mar 24, 2025

    @rodolforg
    Contributor

    No problem, as Svarov said, we aren't native English speakers too.

    I'm curious: what do you need to compute with angles to convert them to real?

  10. zaynopenapp commented on Mar 28, 2025

    @zaynopenapp
    Author

    I want to create a controller using bones. I get the angle value from the bone and normally convert it to a real number. The real value is then connected to another formula.

    As discussed in the forum ([link](https://forums.synfig.org/t/how-to-fit-a-list-range-to-another/12583?u=zainal)), the value must be of type "real." However, in my case, the bone's angle value comes from a formula, such as atan2 or a vector's angle. The problem is that I can't link the values because Synfig doesn't allow direct connections from "real" to "angle."

    My goal: Bone Angle → Real → Angle (atan2 conversion)
    This way, I can link the real value to other formulas, such as range mapping.

  11. Stargazer10101 commented on Apr 2, 2025

    @Stargazer10101
    Contributor

    My goal: Bone Angle → Real → Angle (atan2 conversion) This way, I can link the real value to other formulas, such as range mapping.

    Alright.

    I observed that the atan2 converter cannot be applied once the real converter is applied to a parameter. But I'm not sure if this is what @zaynopenapp is trying to point out.

    I think I was right about this. There are different value types in synfig and each type has a different set of convert types available to it. The value type "Real" doesn't have aTan2 as a convert type (https://wiki.synfig.org/convert). I'm working on this.

  12. morevnaproject commented on Apr 13, 2025

    @morevnaproject
    Member

    I think he just wants an "Angle" converter for the real type. Currently we have ValueNode_Real that takes an angle and translates it into a real type. The guy wants the opposite, a converter that takes real type and translates it into angle type. Which I'd say a reasonable request.

    Let's do this and see if that will help. :)

    @Stargazer10101 I do not understand the meaning of #3542. And I guess that implementing Real-to-Angle converter should be enough to resolve the issue.

  13. Stargazer10101 commented on Apr 13, 2025

    @Stargazer10101
    Contributor

    @Stargazer10101 I do not understand the meaning of #3542. And I guess that implementing Real-to-Angle converter should be enough to resolve the issue.

    But there is no "Angle" converter in synfig...

  14. rodolforg commented on Apr 13, 2025

    @rodolforg
    Contributor

    But there is no "Angle" converter is synfig...

    That's exactly what he proposed to be done 😄
    y = atan(x) means what angle y which gives tangent x, i.e. x = tan(y) (in a less formal mathematics...)

    So, why atan would return a Real?

    For me, the big question is: why would anybody need Angle -> Real converter? Sadly the issue author didn't clarify, but we can create it anyway... And that's what Konstantin is suggesting.

  15. Stargazer10101 commented on Apr 13, 2025

    @Stargazer10101
    Contributor

    So a new converter "Angle" is to be created that does real -> angle conversion. I'll work on this.

  16. BobSynfig commented on Apr 16, 2025

    @BobSynfig
    Collaborator

    Question: why "closed as completed" while PRs have not been merged yet?
    Shouldn't it be the maintainers to do so, once they approved and merged PRs, and the issues reported in release notes?

  17. zaynopenapp commented on Apr 19, 2025

    @zaynopenapp
    Author

    Sorry, I don't understand GitHub. Maybe I misinterpreted it. It might be better to revisit or reopen the topic. Thank you for your help

  18. rodolforg commented on Apr 19, 2025

    @rodolforg
    Contributor

    It is okay :)
    We prefer to close an issue only after a PR being merged.

    Btw, could you please now show us how you are using this new converter?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions