From 958750f1ab8a9fe0ae48e7af3a1e6575dd63c04e Mon Sep 17 00:00:00 2001 From: "James.Hester" Date: Fri, 11 Jan 2019 09:06:09 +1100 Subject: [PATCH] Fixed incorrect height calculation when interpolating between two non-diagnonal points. --- src/Lib/Array/array.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lib/Array/array.cxx b/src/Lib/Array/array.cxx index 4ec2dbac..a4e272d6 100644 --- a/src/Lib/Array/array.cxx +++ b/src/Lib/Array/array.cxx @@ -729,10 +729,10 @@ double TGArray::altitude_from_grid( double lon, double lat ) const { dx = xlocal - x1; dy = ylocal - y1; if (x1==x2) { - elev = z1+dy*(z2-z1); + elev = z1+dy*(z2-z1)/(y2-y1); } else if (y1==y2) { - elev = z1+dx*(z2-z1); + elev = z1+dx*(z2-z1)/(x2-x1); } else { //diagonal: project onto 45 degree line int comp1 = x2-x1;