(closed) Question about Cos & Sin

About Monkey 2 Forums General Programming Discussion (closed) Question about Cos & Sin

This topic contains 5 replies, has 4 voices, and was last updated by  Jesse 2 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2609

    degac
    Participant

    Hi

    I’m playing with MX2, and I decided to do a simple analog clock, porting some old code from BlitzMax.

    I’ve a problem understanding why I get different results in just a simple ‘function’ like this one

    This algorithm should draw a ‘regular’ shape – 12 rays with the same angle.

    What’s wrong?

    #2613

    degac
    Participant

    Nevermind

    MX2 uses RADIAN, while BMAX degree.

     

    Solved & closed!!!

     

    Ps: I should have read BEFORE the manual!!!

    #2614

    ImmutableOctet
    Participant

    You’re looking for degrees, Monkey 2 made the switch to radians.

    Sin(n * (Pi / 180))

     

    Here’s an example of how to convert to and from radians.

    EDIT: Just realized you figured it out.

    #2615

    degac
    Participant

    Thanks

    I’m starting from the ‘basis’… so porting old programs/algorithms I think is the best way to understand MX2 and the differences/features.

    I’m thinking I need to create a ‘conversion-library’ to manage ‘old’ code (Sind is much better than  Sin(Rad(n))…)

    By the way, I think it should be available by default in the Math module some functions for translating from Radian to Degree and viceversa.

    #2668

    DruggedBunny
    Participant

    Are there any built-in conversion functions? Reckon radians make sense to about 0.000000001% of all humans in comparison to degrees!

    #2670

    Jesse
    Participant

    @immutableoctet

    I think you got both functions reversed:

    Pi/180.0 is not 57.29577….

    neither is 180.0 /Pi  =  0.017453….

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.