1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice
  3. Greetings Guest, Having Login Issues? Check this thread!
    Dismiss Notice
  4. Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
    Dismiss Notice

Anyone know Trig?

Discussion in 'Off Topic' started by Elric_Soban, Oct 25, 2011.

  1. Elric_Soban

    Elric_Soban Babbling Loonie
    Stratics Veteran Stratics Legend

    Dec 7, 2004
    Likes Received:
    I have an X,Y Coordinate, an angle, and a distance.
    If i start at point X, Y, travel along the angle for the given distance, I should be able to calculate the resulting new X,Y.

    ive been scouring the net for the formula, with no luck. so far i have

    X2 = X + (distance * Cos(angle))
    Y2 = Y + (distance * Sin(angle))

    but it doesn't appear to be working.
    Any help? Thanks!

    Ok I have determined that infact:

    X2 = cos(angle) * distance
    Y2 = sin(angle) * distance

    What if i have a starting point other than 0,0? How does that new co-ord fit in?
  2. Loren

    Loren Seasoned Veteran
    Stratics Veteran

    Aug 5, 2011
    Likes Received:
    Assuming (carefull with that),
    We are talking about angle with respect to the positive X-axis, then this will be eazy peazy lemon squeezy.

    What the angle is referenced from is much more important than the starting point, imho.

    You will not need a formula per se, just recall the relationship between x,y,r, and theta.
    change in X = r*cos(theta), change in y = r*sin(theta)
    r = distance traveled.

    So, plug in your distance as r, and solve. Add or subtract as appropriate with the coordinate pair that is your origin.
  3. Taylor

    Taylor Former Stratics CEO (2011-2014)
    VIP Stratics Veteran Supporter Alumni Campaign Benefactor Alumni

    Oct 21, 2008
    Likes Received:
    I can almost balance a checkbook.