From 27403e2fef5afe9b1316dd48487a81d54c73cc84 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 25 May 1999 11:54:21 +0000 Subject: [PATCH] Whups, fixed a simple bug so you can now fly across the lon = +/-180 boundary without any problems. --- Lib/Bucket/newbucket.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/Bucket/newbucket.cxx b/Lib/Bucket/newbucket.cxx index ff3c7b42..bb6f8bb9 100644 --- a/Lib/Bucket/newbucket.cxx +++ b/Lib/Bucket/newbucket.cxx @@ -97,7 +97,14 @@ FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) { double span = bucket_span( clat ); // walk dx units in the lon direction - result.set_bucket( dlon + dx * span, clat ); + double tmp = dlon + dx * span; + while ( tmp < -180.0 ) { + tmp += 360.0; + } + while ( tmp >= 180.0 ) { + tmp -= 360.0; + } + result.set_bucket( tmp, clat ); return result; } -- 2.39.5