Let delta_long
and delta_lat
be the differences, in degrees, in the GPS coordinates of the building's corners. Let delta_x = 320
and delta_y = 480
(feet, let's say). Then:
vertical_scale = delta_y/delta_lat
with units feet/degree latitude
horizontal_scale = delta_x/(cos(latitude)*delta_long)
with units feet/degree longitude.
The cos(latitude)
factor compensates for the varying length of 1 degree of longitude
as one moves from the equator to the poles. We can assume for this application that
it won't change appreciably between the north and south ends of the building.
Then for any nearby (lat,long) point, subtract off the coordinates of the southwest
corner of the building, and apply the vertical and horizontal scales in the obvious
way to locate that point with respect to the building layout.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…