Hello,
In a cartesian coordinate system, I want to be able to predict a compass angle of an object. So I have a base position of (0,0) and then a
distance and compass angle to an object. This object also has a heading and a speed. How can I predict the new compass angle of the object with that
information?
my coordinate system is like this:
0 y | | 270-------------- 90 x | | 180
I think the first step
would be to compute the cartesian coordinates of the object:
angle gets converted to radians
x = distance * sin(radians);
y = distance * cos(radians);
then the next step would be to compute the predicted x and y from the speed and heading of the object:
predictedx = ??
predictedy = ??
then finally convert
back to an angle, and distance:
newDistance = sqrt(predictedx^2 + predictedy^2);
newAngle = atan2(predictedy, predictedx);
Can anyone help me fill in the blanks?? Are my other things correct?
Thanks!
Alex
In a cartesian coordinate system, I want to be able to predict a compass angle of an object. So I have a base position of (0,0) and then a
distance and compass angle to an object. This object also has a heading and a speed. How can I predict the new compass angle of the object with that
information?
my coordinate system is like this:
0 y | | 270-------------- 90 x | | 180
I think the first step
would be to compute the cartesian coordinates of the object:
angle gets converted to radians
x = distance * sin(radians);
y = distance * cos(radians);
then the next step would be to compute the predicted x and y from the speed and heading of the object:
predictedx = ??
predictedy = ??
then finally convert
back to an angle, and distance:
newDistance = sqrt(predictedx^2 + predictedy^2);
newAngle = atan2(predictedy, predictedx);
Can anyone help me fill in the blanks?? Are my other things correct?
Thanks!
Alex