How to find position in lat,long given direction,speed ,time and initial position?
-
Hello, Does any body knows the formula for getting new position of moving object given initial position (latitude1,longitude1),speed,direction and time. I want to find the location of moving object after time t. Thanks
-
Answer:
Actually there are 2 answers to this. One method uses a technique called Rhumbline(sp?) (or straight line) another uses something called the great circle. I once wrote a program to do this for hurricane tracking. The method I used was the straight line. For what i was doing this was fine however for navigation the great circle method is usually prefered. This code is old C (not even C++). Hope this helps you. Note: this forum destroys my coding style (all my indentations are striped). /* * Constants and macros used to * calculate the projected position of * the storm. */ #define PI 3.14159265358979323846 #define DEG_PER_RAD (180.0 / (float) PI) /* Ratio of Degrees to radians */ #define DEG_TO_RAD(theta) ((theta) / DEG_PER_RAD) /* * The following does a straight line projection * of the position of a storm given current * position, heading, speed, and a time interval. * For further information * see "Computers for Sea and Sky". */ void project_pos (start_lat, start_lon, heading, speed, interval, proj_lat, proj_lon) float start_lat; float start_lon; int heading; int speed; float interval; float * proj_lat; float * proj_lon; { float rad_lat; float rad_lon; float rad_heading; float rad_of45; rad_of45 = DEG_TO_RAD (45); rad_lat = DEG_TO_RAD (start_lat); rad_lon = DEG_TO_RAD (start_lon); rad_heading = DEG_TO_RAD (heading); *proj_lat = (interval * speed * cos (rad_heading) / 60.0) + start_lat; if (*proj_lat > 90.0) { *proj_lat = 180.0 - *proj_lat; } else if (*proj_lat < -90.0) { *proj_lat = -180.0 - *proj_lat; } switch (heading) { case 90: case 270: *proj_lon = start_lon - ((interval * speed * sin (rad_heading)) / (60.0 * cos (rad_lat))); break; default: *proj_lon = start_lon - (DEG_PER_RAD * tan (rad_heading) * ((log (fabs (tan (rad_of45 + (DEG_TO_RAD (*proj_lat) / 2.0))))) - (log (fabs (tan (rad_of45 + (rad_lat / 2.0))))))); if (*proj_lon > 180.0) { *proj_lon -= 360.0; } else if (*proj_lon < -180.0) { *proj_lon += 360.0; } break; } }
avinash_... at Yahoo! Answers Visit the source
Other answers
easy stuff but give me 10 pts first ..... its not worth deriving for 2 points
inder780
The best way to do this is to use some basic precalc knowledge. Using parametric functions, you create two equations for X(t)= blah and Y(t)= Blech. *Note, I get the feeling this only works for objects with a constant speed* X(t) would equal the quantity of the speed multiplied by the x-component of the direction, multiplied by t, plus the initial position. The x-component of the direction can be attained by taking the cosine of the angle. For instance, a particle moving at 60 degrees at a speed of 5mph from the initial starting point of (2,3) would have an X(t) equation of X(t)=5cos(60)t + 2 The Y(t) component would be almost exactly the same, except instead of cosine for the angle, it would be sine
a9secondsleeper
Related Q & A:
- How To Find Consolidated Internet Speed?Best solution by Yahoo! Answers
- How to find out if it is possible to contruct a binary matrix with given row and column sums?Best solution by Mathematics
- How to find the time complexity?Best solution by Stack Overflow
- How long does the summer time last in Finland?Best solution by Yahoo! Answers
- How long does UPS real time shipping take?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.