I have a point in cartesian coordinate system for example : x = 3 & y = 5
And I want to get new coordinate of this point after a move through a distance in the given direction (in degrees).
How I can do for get new x and new y ?
Well-known formulas from the school geometry:
new_x = x + distance * Math.Cos(angle_degrees * Math.Pi / 180)
new_y = y + distance * Math.Sin(angle_degrees * Math.Pi / 180)
Note that angle_degrees = "given direction"
is measured from the positive x-axis moving toward the positive y-axis
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With