|
|
@@ -211,14 +211,14 @@ impl OrthograficView {
|
|
211
|
211
|
tiles
|
|
212
|
212
|
}
|
|
213
|
213
|
|
|
214
|
|
- pub fn radius_physical_pixels(map_view: &MapView) -> f64 {
|
|
|
214
|
+ pub fn diameter_physical_pixels(map_view: &MapView) -> f64 {
|
|
215
|
215
|
2.0f64.powf(map_view.zoom) * (FRAC_1_PI * f64::from(map_view.tile_size))
|
|
216
|
216
|
}
|
|
217
|
217
|
|
|
218
|
218
|
pub fn transformation_matrix(map_view: &MapView) -> Matrix3<f64> {
|
|
219
|
219
|
let (scale_x, scale_y) = {
|
|
220
|
|
- let radius = Self::radius_physical_pixels(map_view);
|
|
221
|
|
- (radius / map_view.width, radius / map_view.height)
|
|
|
220
|
+ let diam = Self::diameter_physical_pixels(map_view);
|
|
|
221
|
+ (diam / map_view.width, diam / map_view.height)
|
|
222
|
222
|
};
|
|
223
|
223
|
|
|
224
|
224
|
let scale_mat: Matrix3<f64> = Matrix3::from_cols(
|
|
|
@@ -290,7 +290,7 @@ impl OrthograficView {
|
|
290
|
290
|
pub fn screen_coord_to_latlonrad(map_view: &MapView, screen_coord: ScreenCoord) -> LatLonRad {
|
|
291
|
291
|
// Point on unit sphere
|
|
292
|
292
|
let sphere_point = {
|
|
293
|
|
- let recip_radius = 2.0 * Self::radius_physical_pixels(map_view).recip();
|
|
|
293
|
+ let recip_radius = 2.0 * Self::diameter_physical_pixels(map_view).recip();
|
|
294
|
294
|
let sx = (screen_coord.x - map_view.width * 0.5) * recip_radius;
|
|
295
|
295
|
let sy = (screen_coord.y - map_view.height * 0.5) * -recip_radius;
|
|
296
|
296
|
let t = 1.0 - sx * sx - sy * sy;
|