• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

Anyone know Trig?

Elric_Soban

Babbling Loonie
Stratics Veteran
Stratics Legend
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?
 

Loren

Seasoned Veteran
Stratics Veteran
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?
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.
 

Taylor

Former Stratics CEO (2011-2014)
VIP
Alumni
Supporter
Stratics Veteran
Stratics Legend
UNLEASHED
Campaign Benefactor
I can almost balance a checkbook.
 
Top