On Feb 23, 12:39 pm, Martin Matysiak <[email protected]> wrote: > I think it depends on the image you are using. Is the scale linear in both > directions (vertical and horizontal)? Then it should be simple mathematics. > > dX = X2 - X1 = e.g. 42 > dLon = Lon2 - Lon1 = e.g. 21 > > LonPerPixel = dLon / dX = 0.5 > > That means, each pixel (in a linear scaled image!) represents a longitude > step of LonPerPixel degrees. You do the same for LatPerPixel (with Y and Lat, > of course) and then it should be pretty simple to get the X/Y coordinates of > the third point. Just get the Lat/Lon differences between the third and the > first or second point, divide the differences through LonPerPixel and > LatPerPixel and you know how much pixels you have to add to your first resp. > second point in order to get the coordinates of the third one! > > However, this could fail if P1 and P2 are either horizontally or vertically > on the same line (as one of the differences would equal zero) or the image > is scaled in any other way. > > Regards, > > Martin Matysiak > homepage <https://martin-matysiak.de> | blog<http://blog.martin-matysiak.de>
Google's Mercator projection is not linear in the vertical direction. It is misleading to suggest it is. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
