Results 1 to 3 of 3

Math Help - Working out destination from starting point, angle and power

  1. #1
    Newbie
    Joined
    May 2009
    Posts
    2

    Working out destination from starting point, angle and power

    Bit of a strange problem and I hope i've posted in the correct place.

    I am writting a computer game (very basic golf) I have three sliders I can set:

    Power(0-100)
    Angle (-90 - 90)
    Start position of ball(represented in the code by an x and y co-ordinate)

    after each is set, then I hit the button "SHOOT"

    I want to know how I can work out the vector from the above (the change in x, and the change in y)

    Although it is for a game its the same principle as paper. Imagine a top down view of a piece of graph paper with each line being numbered along the x axis and same on the y



    Any help would be really appreciated greatly
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member billa's Avatar
    Joined
    Oct 2008
    Posts
    100
    Hopefully I can help

    First of all I am going to assume that you have some kind of maximum velocity constant for your ball.

    The vector you want would probably be...
    dx = (power/100)*Maximum_Velocity*cos(angle)
    dy = (power/100)*Maximum_Velocity*sin(angle)

    That would be the velocity vector and you would add it to the position vector

    Tell me if this works. I used to program games so I might be able to help if you need anything else.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2009
    Posts
    2
    I'm not very familiar with vectors. When i read it I assumed i'd take the dx value and dy value and add them to x and y representing the current position of the ball? But this does't work.

    The figures output are nowhere near so i think i misunderstood you, sorry. Could someone clear this up?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. starting point for this integral?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 23rd 2011, 10:58 AM
  2. Replies: 1
    Last Post: March 5th 2010, 11:46 AM
  3. I need a starting point for this problem!
    Posted in the Algebra Forum
    Replies: 1
    Last Post: February 6th 2010, 07:10 AM
  4. need a starting point urgently.
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: January 19th 2009, 06:59 AM
  5. Mathematics...a starting point?
    Posted in the Math Topics Forum
    Replies: 4
    Last Post: November 19th 2008, 06:47 PM

Search Tags


/mathhelpforum @mathhelpforum