# Math Help - converting between two cordinate systems

1. ## converting between two cordinate systems

I'm trying to make a conversion between two coordinate systems, pixel x,y and latitude, longitude. Say we have two points, the first being 53,12 which represents latitude 42 longitude -119.5, the second 42,56 representing latitude 39 longitude -119.3. How would I find the pixel distance between the two longitudes and two latitudes?
It may seem like a silly request giving all the datums and map projection math readily available on wikipedia but this particular map im using does not follow any standard projection. I'm mathematically representing a mesh of several xy points mapping to latitudes and longitudes to properly calibrate plotting cities in a state.

2. Since you say "Latitude and Longitude", this apparently is a projection of a globe onto a flat screen. Without knowing the projection, the information you give is not enough. In particular, the relation between "latitude and longitude" and pixels cannot be linear.

3. Originally Posted by lolboxen
I'm trying to make a conversion between two coordinate systems, pixel x,y and latitude, longitude. Say we have two points, the first being 53,12 which represents latitude 42 longitude -119.5, the second 42,56 representing latitude 39 longitude -119.3. How would I find the pixel distance between the two longitudes and two latitudes?
It may seem like a silly request giving all the datums and map projection math readily available on wikipedia but this particular map im using does not follow any standard projection. I'm mathematically representing a mesh of several xy points mapping to latitudes and longitudes to properly calibrate plotting cities in a state.
In your example you have 3 degrees difference in latitude. That's about 200 miles at the earth's surface. For the mapping it depends a lot on the method used to generate the map you have.

Search the internet for some of these terms:
Transverse Mercator Projection
Lambert Conformal Conic projection
Polyconic Projection
Unprojected maps

Most likely the geographic data relies on the state plane coordinate system.
IF the information you are attempting to provide or use is NOT critical, then you can "map" the pixels to the lat/long data.

Latitude is North/South & Longiture is East/West

Pixel X: is Left to Right & Pixel Y: is Top to Bottom

Determine the difference in latitudes and equate that to the difference in vertical pixels
.
$\dfrac{ (Py1 - Py2)}{(Latitude1-Latitude2)}=\text{VerticalRatio}$
.
$\dfrac{ (12 - 56)}{(42-39)}= -14.7$ pixels per degree (be careful of the sign/direction)

Determine the difference in longitudes and equate that to the difference in horizontal pixels

$\dfrac{ (Px1 - Px2)}{(Longitude1-Longitude2)}=\text{HorizontalRatio}$

$\dfrac{ (53 - 42)}{(-119.5) - (-119.3))}= -55$ pixels per degree of longitude.

IF your map is distorted (and it appears to be) then you'll need to transform the coordinate grids in addition to scaling.

IF your product requires more accuracy, then convert the geodetic coordinates (Lat/Long) to state plane coordinates. Then match the state plane coordinate to the pixels. The conversion from one to the other is simple as indicated above.

Convert Latitude/Longitude to State Plane to pixel coordinates
&
then compute pixel values to state plane to lat/long.

.

4. Originally Posted by aidan
In your example you have 3 degrees difference in latitude. That's about 200 miles at the earth's surface. For the mapping it depends a lot on the method used to generate the map you have.

Search the internet for some of these terms:
Transverse Mercator Projection
Lambert Conformal Conic projection
Polyconic Projection
Unprojected maps

Most likely the geographic data relies on the state plane coordinate system.
IF the information you are attempting to provide or use is NOT critical, then you can "map" the pixels to the lat/long data.

Latitude is North/South & Longiture is East/West

Pixel X: is Left to Right & Pixel Y: is Top to Bottom

Determine the difference in latitudes and equate that to the difference in vertical pixels
.
$\dfrac{ (Py1 - Py2)}{(Latitude1-Latitude2)}=\text{VerticalRatio}$
.
$\dfrac{ (12 - 56)}{(42-39)}= -14.7$ pixels per degree (be careful of the sign/direction)

Determine the difference in longitudes and equate that to the difference in horizontal pixels

$\dfrac{ (Px1 - Px2)}{(Longitude1-Longitude2)}=\text{HorizontalRatio}$

$\dfrac{ (53 - 42)}{(-119.5) - (-119.3))}= -55$ pixels per degree of longitude.

IF your map is distorted (and it appears to be) then you'll need to transform the coordinate grids in addition to scaling.

IF your product requires more accuracy, then convert the geodetic coordinates (Lat/Long) to state plane coordinates. Then match the state plane coordinate to the pixels. The conversion from one to the other is simple as indicated above.

Convert Latitude/Longitude to State Plane to pixel coordinates
&
then compute pixel values to state plane to lat/long.

.

This answer was perfect. The information is not critical, basically its a map to show locations of a client we have. Upon further research I found that Lambert Conformal Conic is almost identical to the map were using. Luckily a wikipedia article has all the necessary equations for that projection. Thanks!