

I want to share with you how I managed the problem. In most cases, you'll be able to compute cos(φ 0) only once, which makes subsequent computations of large numbers of points really cheap. This is simple equirectangular projection. Furthermore, to convert from angles (measured in radians) to lengths, you multiply by the radius of the earth (which in this model is assumed to be a sphere). Instead you should use cos(φ 0) as the aspect ratio, where φ 0 denotes a latitude close to the center of your map. The ratio between these should not be 1:1, though. You can simply use the horizontal axis x to denote longitude λ, the vertical axis y to denote latitude φ. If the part of the surface of the earth which you want to draw is relatively small, then you can use a very simple approximation. The shortest distance between two points on the surface of the sphere would go through that sphere, whereas distances on the earth are mostly geodesic lengths following the surface. But even there you'd not get correct distances automatically. The formulas you quote compute x/y/z, i.e. For smallish parts of earth's surface, transverse Mercator is quite common. Many different map projections do exist, which can achieve different compromises between preservations of lengths, angles and areas. You have to accept some kind of deformation. When you convert lat/lon coordinates from the sphere to x/y coordinates in the plane, you cannot hope that all lengths will be preserved by this operation. There is no isometric map from the sphere to the plane.
#ORCAFLEX COORDINATE CONVERSION X VS Y HOW TO#
YPos = (app.radius) * s(latitude) Īlso i tried this link but still not work with me well!Īny help how to convert from(latitude, longitude) to (x,y) ? ZPos = (app.radius) * Math.sin(latitude) * Math.sin(longitude) XPos = (app.radius) * Math.sin(latitude) * s(longitude) One of the solution i found the following, but it doesn't give me correct answer! latitude = Math.PI * latitude / 180 (3) then again calculate distance between the two points in the x,y coordinatesĪnd see if it give me the same result in point(1) or not. (2) then convert the two positions into x,y coordinates. (1) firstly, i take two positions and calculate the distance between them using maps.

I am following these steps to test the answer:

I found many links about this topic and applied it, but it doesn't give me the correct answer! I want to convert GPS location (latitude, longitude) into x,y coordinates.
