Hope somebody can help me 🙂
I’m trying to scale a point from a map (Latitude, Longitude) to an image (x, y).
For that i need to find the scale factor between the 2 NON-SIMILAR rectangles (i think).
I’ll clarify, let’s say:
Rectangle 1: A(40.0, 50.0) B(40.0, 56.0) C(43.0, 56.0) D(43.0, 50.0)
(Latitude Delta = 3, Longitude Delta = 6).
Rectangle 2: E(0, 0) F(500, 0) G(500, 300) H(0, 300)
(X Delta = 500, Y Delta = 300).
How can i scale a point P(41.5, 52.5) from rectangle 1 to point (x, y) on rectangle 2?
UPDATE:
General idea:
I’m trying to display the user current location (Lat, Lon) on a custom image (not a map image, a drawing of my own) therefor i can’t use maps (MKMapKit, Google, Tom-Tom).
I have the user current location (via CoreLocation) and an image (800×460).
The area that i’m mapping is small so i don’t need to worry about the earth’s curve.
I’m trying to find a formula that’ll help me scale my user (Lat, Lon) location into my image (on my iPhone screen)
Thanks!!!
Well , getting the rectangle that is similar with the first one but fits in the second one is not hard. Here’s how:
I’m not sure this is what you are trying to achieve.
Regards,
George