gasrascope.blogg.se

Orcaflex coordinate conversion x vs y
Orcaflex coordinate conversion x vs y















Calculates x based on cos of average of the latitudes This function converts lat and lng coordinates to GLOBAL X and Y positions # Now I can calculate the global X and Y for each reference point #\\ ScrY: 178.9, // Maximum Y position on screen

orcaflex coordinate conversion x vs y

ScrX: 276, // Maximum X position on screen ScrY: -0.5, // Minimum Y position on screen ScrX: 23.69, // Minimum X position on screen The objects containing this data are shown below. Once I have the global reference area in lat and lng, I do the same for screen positions. In my case, I wanted to convert coordinates in a small area (about 500m square), so I related the projection point to another 2 points, getting the global positions and relating to local (on screen) positions, just like this:įirst, I choose 2 points (top-left and bottom-right) around the area where I want to project, just like this picture: I've used the equirectangular projection just like said, but this method gives you X and Y positions related to the globe (or the entire map), this means that you get global positions. 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.

orcaflex coordinate conversion x vs y

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

#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)

orcaflex coordinate conversion x vs y

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.















Orcaflex coordinate conversion x vs y