I have the relative position for some point P2 on the Map as x y z coordinates. This position is relative to some position P1 define by its longitude and latitude and heading. how can I compute the longitude and latitude for P2?
For example: P2: x = 24, y = 26, z = 30 P1: lat/lng: 53.090734, 10.435428 with heading 110°.
P2 is relative to P1. How to compute P2 lat/lng?
This is what I tried but it doesn't work.
latP2 = latP1 - (Math.sin(Math.toRadians(heading)) * X + Math.cos(Math.toRadians(heading)) * Y) * (1.0 / 111000.0);
lonP2 = longP1 + (Math.cos(Math.toRadians(heading)) * X + Math.sin(Math.toRadians(heading)) * Y) * (1.0 / 71500.0);
I think I don't need to use z value in my calculation: