convert xy coordinate to latlong
-
Hello can anybody help me to convert xy coordinate to latitude and longitude in visual studio.net. pls give me the code or explanation for this.
-
Hello can anybody help me to convert xy coordinate to latitude and longitude in visual studio.net. pls give me the code or explanation for this.
Just use some math and convert this code into the other direction: Private Function LaLo_to_XYZ(ByVal Lattitude As Double, ByVal Longitude As Double) As XYZ Dim POS As XYZ 'bereken de afstand van het gegeven punt naar het midden toe , van bovenaf gezien... Dim radianLat As Double = (90 - Lattitude) * Math.PI / 180 Dim straal As Double = Math.Sin(radianLat) * StraalDome POS.Z = -(Math.Cos(radianLat) * StraalDome) 'bereken de longitude positie erboven op Dim radianLon As Double = Longitude * Math.PI / 180 POS.Y = Math.Sin(radianLon) * straal POS.X = Math.Cos(radianLon) * straal Return POS End Function To point your more in the right way First change your distance from center of the ball to a radius of 1.=>to get a new xyz point. Then calculate the triangle that lies flat on the table to get the degrees. Then calculate the triangle that stands up/down-wards on the triangle mentioned before.