# Transform a lat/lon coordinate to x/y pixel on a Google Earth screen

For a given Google Earth URL (for example https://earth.google.com/web/@33.83405747,-117.89835255,51.77456494a,140.84823168d,35y,0h,0t,0r)

I want to find the lat/lng coordinates of the corners of the screen, so that I can calculate any pixel location on the screen given the lat/lon. The screenshot of this Google Earth page would look like this:

For example in the above link the screen size is 1280 × 720. The coordinates 33.83405747,-117.89835255 would be the exact center, so the pixel coordinates would be (640,360). Now I want to calculate these coordinates for any given lat/lon(Of course, assuming they will lie on this field of view.) The breakdown of a Google Earth URL would be this:

1. 33.83405747 is latitude
2. -117.89835255 is longitude
3. 51.77456494a is the altitude of the center from sea level(I think it includes the building height too, if there is any at the center. It is in meters).
4. 140.84823168d is apparently the distance of the viewer from the center(not sure what the units are and apparently it is not from the sea level).
5. 35y is the field of view.
6. 0h is the heading
7. 0t is the tilt
8. 0r is the rotation of the view

I'm assuming that I'll keep heading, tilt and rotation always 0.

## 1 Answer

If the FOV is 35°, and the height is 193m, try:

``````X = h tan(35°) = 135.14 m
dX = X/1280    = 10.56 cm
``````

The numbers look reasonable, based on the image given.