Help with this range formula!

ChechesoftChechesoft Member, PRO Posts: 171
edited June 2015 in Working with GS (Mac)

Hi, after several hours trying to make this formula to work (range of an projectile) I still cant make it work...

I have fiddling with the brackets, but without any success... can anybody spot the problem?:

Comments

  • gamestudentgamestudent Member Posts: 504

    mind blown

    @Socks

    @RThurman

    Maybe these guys can help you out.

  • SocksSocks London, UK.Member Posts: 12,822

    :o

    Runs for cover . . . . .

  • SocksSocks London, UK.Member Posts: 12,822

    Could you upload the project - or at least the part with this equation ?

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    @Chechesoft

    Are you just getting an invalid expression? Or is it working, but not as intended?

    Follow us: Twitter - Website

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited June 2015

    I think I see the problem... not sure though.

    (2*Game.gravedad*200) 
    
    should be ((2*Game.graveded)*200). 
    

    At least with static values in place of variables in my test project, the equation worked.

    @Chechesoft

    Follow us: Twitter - Website

  • ookami007ookami007 Member Posts: 581

    I'm pretty sure that's Scotty's transwarp equation!

    Scotty: The notion of transwarp beaming is like trying to hit a bullet with a smaller bullet whilst wearing a blindfold, riding a horse.

  • ChechesoftChechesoft Member, PRO Posts: 171

    @AlchimiaStudios said:
    Chechesoft

    Are you just getting an invalid expression? Or is it working, but not as intended?

    I am getting (after lot off tries) a valid expression, but the result is not correct for some reason.

  • ChechesoftChechesoft Member, PRO Posts: 171

    @AlchimiaStudios said:
    I think I see the problem... not sure though.

    (2*Game.gravedad*200) 
    
    should be ((2*Game.graveded)*200). 
    

    At least with static values in place of variables in my test project, the equation worked.

    Chechesoft

    Thanks, I'll try it later today, but It seems it would not change anything really, the order of a multiplication should not change the results....

    My equation give me a valid number, just not the number that should give me...

  • RainbrosRainbros Member Posts: 124

    At a glance, looks like your parentheses are a bit off...

    try this:

    ((velo * cos(angulo))/gravedad) * (velo * sin(angulo) + sqrt(velo^2 * (sin(angulo)^2)

    • 2 * gravedad * 200))
  • ChechesoftChechesoft Member, PRO Posts: 171

    Thank Rainbros, but it didnt work neither... (it just gave me 0)
    Anyway, Thanks to all....I have given up (for now), and used a workaround formula that works pretty well for what I was trying... "Sin(angle)" rules!

    When I finish my current project, I will try to return to this range formula!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited June 2015

    Don't give up! The equation does work. If you always get a "0" then its probably some simple thing like an extra space or a missing parenthesis.

    Attached is a working model. You can check the GS version against one thats working here:
    http://www.convertalot.com/ballistic_trajectory_calculator.html

  • ChechesoftChechesoft Member, PRO Posts: 171

    Hi Rthurman, I do t always get 0 (just with rainbros last correction) but I get results that are incorrect...
    I gived up because I found a Workaround for what I needed that works perfectly!
    But I cant wait to get home and check your file, it seems promising!!!!!! Surely I want to tackle this equation!
    Thanks!

  • ChechesoftChechesoft Member, PRO Posts: 171

    @RThurman said:
    Don't give up! The equation does work. If you always get a "0" then its probably some simple thing like an extra space or a missing parenthesis.

    Attached is a working model. You can check the GS version against one thats working here:
    http://www.convertalot.com/ballistic_trajectory_calculator.html

    Thanks a lot RThurman!!! Your equation does it! I dont really get yet what went wrong with mine, but yours does the trick!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Glad its working for you!

Sign In or Register to comment.