Shop OBEX P1 Docs P2 Docs Learn Events
GPS Calculations Question — Parallax Forums

GPS Calculations Question

Brian CarpenterBrian Carpenter Posts: 728
edited 2012-05-17 08:30 in General Discussion
I am looking to see how to create a location (Lat,Lon) for UNIT 2 based on the following information.
  • I know the location of UNIT 1 (Lat, Lon)
  • I know the heading of travel of UNIT 1
  • I know that i want UNIT 2 to be 200 feet from UNIT 1, and the line between UNIT 1 and UNIT 2 is perpendicular to the heading of UNIT 1
Looking for some math help.
Thanks

Comments

  • David BDavid B Posts: 592
    edited 2012-05-16 08:49
    I think you need to provide more information.

    With what you've specified so far, unit 2 could be either 200 feet to the left of unit 1 or 200 feet to the right.
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2012-05-16 23:49
    Good call. Let's go to the left
  • Mark_TMark_T Posts: 1,981
    edited 2012-05-17 02:55
    So the first step is to convert to local cartesian coordinate system (assuming the units are close together and not the other side of the globe!).

    Then you do everything with 2D vectors. Headings are straightforward in cartesian coordinates. Conversion from lat/lon to cartesian coords can either be done the accurate way (allowing for the earth not being exactly spherical) or the rough-and-ready way where you assume the lines of longitude are spaced according to cosine(lattitude).

    BTW what do you want to get out of the equations? A heading for unit 2?
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2012-05-17 06:46
    I am looking to get lat, lon fou unit 2. It's heading will be the same as unit 1
  • David BDavid B Posts: 592
    edited 2012-05-17 08:30
    Probably someone will roll out the raw math equations for this pretty soon, full of nested sine and cosine function calls, but having sort of a geometrical mental picture of the situation usually helps me feel more confident about understanding this kind of thing.

    You could start by noting that unit 2 is somewhere on the circle that has a 200 foot radius centered at the location of unit 1.

    The heading of unit 1 will specify a point on that circle. The location of unit 2 will then be 90 degrees to the left of that point, also on the circle.
Sign In or Register to comment.