Weird result when using the Cosine function

RumiRumi Member, PRO Posts: 343
edited November -1 in Working with GS (Mac)
In my app, I have a trignometry calculator feature. It all works fine Until I use the cosine button. The sine and tangent buttons work fine but the cosine button just turns the final number to 1 and if I do it agian to 0.9somethingsomething and when I press it again nothing happens. I quadrople checked the "code" and even deleted the actor and made a new one! IDK is it the function or what?

Comments

  • PhoticsPhotics Member Posts: 4,172
    One possible idea... check the attribute value with the new GameSalad debugger. The data displayed in a GameSalad game might be different than what's actually stored.
  • RumiRumi Member, PRO Posts: 343
    Nope, already tried that!
  • RumiRumi Member, PRO Posts: 343
    bump
  • calvin9403calvin9403 Member Posts: 3,186
    what do the button do?

    and the number gets smaller when the degrees are higher(in 0 to 90)
  • RumiRumi Member, PRO Posts: 343
    one actor displays attribute "Trig Entry" When the button is pressed for cosine, it changes "trig entry" to cos(trig entry) I double checked everything!
  • RumiRumi Member, PRO Posts: 343
    bump
  • RumiRumi Member, PRO Posts: 343
    bump
  • RumiRumi Member, PRO Posts: 343
    bump bump bump
  • RumiRumi Member, PRO Posts: 343
    Bump
    bump
    bump
    bump
    bump
  • Rob2Rob2 Member Posts: 2,402
    There is no problem with the cosine function so your project has probably just got an error or a scrambled actor/behaviour somewhere.
  • RumiRumi Member, PRO Posts: 343
    Here is a video of my project! can someone please spot the error!
    http://dl.dropbox.com/u/36502573/Bug in Cosine.mov
  • aarioaario Member, PRO Posts: 256
    its 100% right nothing is wrong with the functions ..its just when you hit sine you are changing the variable and then when you hit the next button you are taking the sin, tan or cos of the changed variable which is why you're numbers aren't appearing as they "should"
  • RumiRumi Member, PRO Posts: 343
    Try googling :cosine of 0.999848
    when i did that I in GS i got 0.999848
    The calculator on google says 0.540430203
  • aarioaario Member, PRO Posts: 256
    ok i would like to mention I'm a materials engineer.

    Im telling you make an attribute that resets the initial value or make a reset button.

    Oh and Google is wrong :)
  • RumiRumi Member, PRO Posts: 343
    Great Idea!
    I'll see if that works!
  • aarioaario Member, PRO Posts: 256
    no prob :)

    Also the google calculator is in radians ..try cos 3.14 (pi)
Sign In or Register to comment.