### ----------------------------------------------------
### -- Geo::Ellipsoid
### -- Licenses: Artistic-2.0
### -- Authors: Tom Browder <tbrowder@acm.org> (translator Perl 5 to Raku, current maintainer), Jim Gibson (CPAN Perl 5 author, v1.12)
### -- File: t/06-at.t
### ----------------------------------------------------
### -- Chunk 1 of 3
# Test Geo::Ellipsoid at

use v6;
use Test;

plan 400;

use Geo::Ellipsoid;

# This original Perl 5 test used the following test functions (the
# resulting Perl 6 versions are shown after the fat comma):
#
#   delta_ok     => is-approx($a, $b, :$rel-tol)
#
#  From the Perl 5 test file:
#    use Test::Number::Delta relative => 1e-6;
#  which translates to:
my $rel-tol = 1e-6;

#$Geo::Ellipsoid::DEBUG = 1;

my $e1 = Geo::Ellipsoid.new(units=>'degrees');
my $e2 = Geo::Ellipsoid.new(units=>'degrees',longitude_sym => True);
my ($lat1, $lon1, $lat2, $lon2, $x, $y);

# tests 1-4
($lat1,$lon1) = $e1.at(-38.369163, 190.874558, 663.027183, 53.574472);
($lat2,$lon2) = $e2.at(-38.369163, 190.874558, 663.027183, 53.574472);
is-approx($lat1,  -38.3656166574817, :$rel-tol);
is-approx($lon1,  190.880662670944, :$rel-tol);
is-approx($lat2,  -38.3656166574817, :$rel-tol);
is-approx($lon2, -169.119337329056, :$rel-tol);

($lat1,$lon1) = $e1.at(-14.608137,30.094655,6390.954467,5.838786);
($lat2,$lon2) = $e2.at(-14.608137,30.094655,6390.954467,5.838786);
is-approx($lat1, -14.5506757312212, :$rel-tol);
is-approx($lon1, 30.1006878108632, :$rel-tol);
is-approx($lat2, -14.5506757312212, :$rel-tol);
is-approx($lon2, 30.1006878108632, :$rel-tol);

($lat1,$lon1) = $e1.at(-41.623677,208.834416,1610.051073,95.264953);
($lat2,$lon2) = $e2.at(-41.623677,208.834416,1610.051073,95.264953);
is-approx($lat1, -41.6250052190667, :$rel-tol);
is-approx($lon1, 208.853654884741, :$rel-tol);
is-approx($lat2, -41.6250052190667, :$rel-tol);
is-approx($lon2, -151.146345115259, :$rel-tol);

($lat1,$lon1) = $e1.at(-67.726400,52.964864,873.162562,51.679717);
($lat2,$lon2) = $e2.at(-67.726400,52.964864,873.162562,51.679717);
is-approx($lat1, -67.72154487153, :$rel-tol);
is-approx($lon1, 52.9810494838027, :$rel-tol);
is-approx($lat2, -67.72154487153, :$rel-tol);
is-approx($lon2, 52.9810494838027, :$rel-tol);

($lat1,$lon1) = $e1.at(-5.158991,259.931626,4773.871059,200.977967);
($lat2,$lon2) = $e2.at(-5.158991,259.931626,4773.871059,200.977967);
is-approx($lat1, -5.19929911014967, :$rel-tol);
is-approx($lon1, 259.916209822012, :$rel-tol);
is-approx($lat2, -5.19929911014967, :$rel-tol);
is-approx($lon2, -100.083790177988, :$rel-tol);

($lat1,$lon1) = $e1.at(-0.582762,29.118576,2946.165884,106.326170);
($lat2,$lon2) = $e2.at(-0.582762,29.118576,2946.165884,106.326170);
is-approx($lat1, -0.590251306822743, :$rel-tol);
is-approx($lon1, 29.1439759994689, :$rel-tol);
is-approx($lat2, -0.590251306822743, :$rel-tol);
is-approx($lon2, 29.1439759994689, :$rel-tol);

($lat1,$lon1) = $e1.at(-26.934636,30.474042,991.354098,72.872537);
($lat2,$lon2) = $e2.at(-26.934636,30.474042,991.354098,72.872537);
is-approx($lat1, -26.9320006429192, :$rel-tol);
is-approx($lon1, 30.4835810246334, :$rel-tol);
is-approx($lat2, -26.9320006429192, :$rel-tol);
is-approx($lon2, 30.4835810246334, :$rel-tol);

($lat1,$lon1) = $e1.at(-62.773742,62.342057,8353.955232,297.642864);
($lat2,$lon2) = $e2.at(-62.773742,62.342057,8353.955232,297.642864);
is-approx($lat1, -62.738893257913, :$rel-tol);
is-approx($lon1, 62.197305731553, :$rel-tol);
is-approx($lat2, -62.738893257913, :$rel-tol);
is-approx($lon2, 62.197305731553, :$rel-tol);

($lat1,$lon1) = $e1.at(68.057252,192.858027,4711.422894,252.341167);
($lat2,$lon2) = $e2.at(68.057252,192.858027,4711.422894,252.341167);
is-approx($lat1, 68.0444035490457, :$rel-tol);
is-approx($lon1, 192.750473587802, :$rel-tol);
is-approx($lat2, 68.0444035490457, :$rel-tol);
is-approx($lon2, -167.249526412198, :$rel-tol);

($lat1,$lon1) = $e1.at(1.348841,276.378914,9829.506468,166.918436);
($lat2,$lon2) = $e2.at(1.348841,276.378914,9829.506468,166.918436);
is-approx($lat1, 1.26225340172628, :$rel-tol);
is-approx($lon1, 276.398904775364, :$rel-tol);
is-approx($lat2, 1.26225340172628, :$rel-tol);
is-approx($lon2, -83.6010952246363, :$rel-tol);

($lat1,$lon1) = $e1.at(27.335146,320.699240,8536.611848,271.060094);
($lat2,$lon2) = $e2.at(27.335146,320.699240,8536.611848,271.060094);
is-approx($lat1, 27.336544790133, :$rel-tol);
is-approx($lon1, 320.612989777828, :$rel-tol);
is-approx($lat2, 27.336544790133, :$rel-tol);
is-approx($lon2, -39.3870102221718, :$rel-tol);

($lat1,$lon1) = $e1.at(34.623205,31.357288,7988.594185,134.837127);
($lat2,$lon2) = $e2.at(34.623205,31.357288,7988.594185,134.837127);
is-approx($lat1, 34.5724140545376, :$rel-tol);
is-approx($lon1, 31.4190231012302, :$rel-tol);
is-approx($lat2, 34.5724140545376, :$rel-tol);
is-approx($lon2, 31.4190231012302, :$rel-tol);

($lat1,$lon1) = $e1.at(-6.856999,130.887597,7763.221087,214.956451);
($lat2,$lon2) = $e2.at(-6.856999,130.887597,7763.221087,214.956451);
is-approx($lat1, -6.91453101371976, :$rel-tol);
is-approx($lon1, 130.847349224089, :$rel-tol);
is-approx($lat2, -6.91453101371976, :$rel-tol);
is-approx($lon2, 130.847349224089, :$rel-tol);

($lat1,$lon1) = $e1.at(-70.754141,43.777574,5605.534780,236.246900);
($lat2,$lon2) = $e2.at(-70.754141,43.777574,5605.534780,236.246900);
is-approx($lat1, -70.7820124418521, :$rel-tol);
is-approx($lon1, 43.6507601360177, :$rel-tol);
is-approx($lat2, -70.7820124418521, :$rel-tol);
is-approx($lon2, 43.6507601360177, :$rel-tol);

($lat1,$lon1) = $e1.at(-69.865357,188.114494,8437.219491,56.767387);
($lat2,$lon2) = $e2.at(-69.865357,188.114494,8437.219491,56.767387);
is-approx($lat1, -69.8238139675753, :$rel-tol);
is-approx($lon1, 188.297759634022, :$rel-tol);
is-approx($lat2, -69.8238139675753, :$rel-tol);
is-approx($lon2, -171.702240365978, :$rel-tol);

($lat1,$lon1) = $e1.at(-79.523730,324.065787,2171.798854,67.387309);
($lat2,$lon2) = $e2.at(-79.523730,324.065787,2171.798854,67.387309);
is-approx($lat1, -79.5162359949416, :$rel-tol);
is-approx($lon1, 324.164444728713, :$rel-tol);
is-approx($lat2, -79.5162359949416, :$rel-tol);
is-approx($lon2, -35.8355552712871, :$rel-tol);

($lat1,$lon1) = $e1.at(74.606774,294.646962,7101.250686,211.655252);
($lat2,$lon2) = $e2.at(74.606774,294.646962,7101.250686,211.655252);
is-approx($lat1, 74.552581484185, :$rel-tol);
is-approx($lon1, 294.521662695934, :$rel-tol);
is-approx($lat2, 74.552581484185, :$rel-tol);
is-approx($lon2, -65.4783373040659, :$rel-tol);

($lat1,$lon1) = $e1.at(28.972667,278.549276,2327.886028,78.654517);
($lat2,$lon2) = $e2.at(28.972667,278.549276,2327.886028,78.654517);
is-approx($lat1, 28.9767972109023, :$rel-tol);
is-approx($lon1, 278.572694719835, :$rel-tol);
is-approx($lat2, 28.9767972109023, :$rel-tol);
is-approx($lon2, -81.4273052801652, :$rel-tol);

($lat1,$lon1) = $e1.at(-20.359063,296.599967,1628.799157,220.382033);
($lat2,$lon2) = $e2.at(-20.359063,296.599967,1628.799157,220.382033);
is-approx($lat1, -20.3702696544288, :$rel-tol);
is-approx($lon1, 296.589859316515, :$rel-tol);
is-approx($lat2, -20.3702696544288, :$rel-tol);
is-approx($lon2, -63.4101406834851, :$rel-tol);

($lat1,$lon1) = $e1.at(-60.365048,156.813021,10.808349,186.644917);
($lat2,$lon2) = $e2.at(-60.365048,156.813021,10.808349,186.644917);
is-approx($lat1, -60.3651441594277, :$rel-tol);
is-approx($lon1, 156.812997908757, :$rel-tol);
is-approx($lat2, -60.3651441594277, :$rel-tol);
is-approx($lon2, 156.812997908757, :$rel-tol);

($lat1,$lon1) = $e1.at(-6.203945,247.684632,324.776721,145.835257);
($lat2,$lon2) = $e2.at(-6.203945,247.684632,324.776721,145.835257);
is-approx($lat1, -6.20637500756398, :$rel-tol);
is-approx($lon1, 247.686280489375, :$rel-tol);
is-approx($lat2, -6.20637500756398, :$rel-tol);
is-approx($lon2, -112.313719510625, :$rel-tol);

($lat1,$lon1) = $e1.at(0.611947,100.746342,9973.981611,131.132873);
($lat2,$lon2) = $e2.at(0.611947,100.746342,9973.981611,131.132873);
is-approx($lat1, 0.55261091016823, :$rel-tol);
is-approx($lon1, 100.813828549171, :$rel-tol);
is-approx($lat2, 0.55261091016823, :$rel-tol);
is-approx($lon2, 100.813828549171, :$rel-tol);

($lat1,$lon1) = $e1.at(-20.725615,342.386744,817.492741,221.236681);
($lat2,$lon2) = $e2.at(-20.725615,342.386744,817.492741,221.236681);
is-approx($lat1, -20.7311674916701, :$rel-tol);
is-approx($lon1, 342.381570767838, :$rel-tol);
is-approx($lat2, -20.7311674916701, :$rel-tol);
is-approx($lon2, -17.6184292321621, :$rel-tol);

($lat1,$lon1) = $e1.at(46.911457,128.191393,9713.277037,65.802158);
($lat2,$lon2) = $e2.at(46.911457,128.191393,9713.277037,65.802158);
is-approx($lat1, 46.9472109419573, :$rel-tol);
is-approx($lon1, 128.307769547944, :$rel-tol);
is-approx($lat2, 46.9472109419573, :$rel-tol);
is-approx($lon2, 128.307769547944, :$rel-tol);

($lat1,$lon1) = $e1.at(-11.235004,282.756437,1175.174596,192.154112);
($lat2,$lon2) = $e2.at(-11.235004,282.756437,1175.174596,192.154112);
is-approx($lat1, -11.2453901777647, :$rel-tol);
is-approx($lon1, 282.754171348951, :$rel-tol);
is-approx($lat2, -11.2453901777647, :$rel-tol);
is-approx($lon2, -77.2458286510488, :$rel-tol);

($lat1,$lon1) = $e1.at(-41.167125,221.956378,7772.438867,65.964741);
($lat2,$lon2) = $e2.at(-41.167125,221.956378,7772.438867,65.964741);
is-approx($lat1, -41.1385887169891, :$rel-tol);
is-approx($lon1, 222.040925759323, :$rel-tol);
is-approx($lat2, -41.1385887169891, :$rel-tol);
is-approx($lon2, -137.959074240677, :$rel-tol);

($lat1,$lon1) = $e1.at(-1.549886,336.466532,3150.908018,129.475800);
($lat2,$lon2) = $e2.at(-1.549886,336.466532,3150.908018,129.475800);
is-approx($lat1, -1.56800166865689, :$rel-tol);
is-approx($lon1, 336.48838856866, :$rel-tol);
is-approx($lat2, -1.56800166865689, :$rel-tol);
is-approx($lon2, -23.5116114313395, :$rel-tol);

($lat1,$lon1) = $e1.at(-63.776699,134.057987,8903.026576,322.164617);
($lat2,$lon2) = $e2.at(-63.776699,134.057987,8903.026576,322.164617);
is-approx($lat1, -63.7135798907925, :$rel-tol);
is-approx($lon1, 133.947510160671, :$rel-tol);
is-approx($lat2, -63.7135798907925, :$rel-tol);
is-approx($lon2, 133.947510160671, :$rel-tol);

($lat1,$lon1) = $e1.at(77.940951,38.523563,1493.070064,336.795873);
($lat2,$lon2) = $e2.at(77.940951,38.523563,1493.070064,336.795873);
is-approx($lat1, 77.9532419255974, :$rel-tol);
is-approx($lon1, 38.4983240629321, :$rel-tol);
is-approx($lat2, 77.9532419255974, :$rel-tol);
is-approx($lon2, 38.4983240629321, :$rel-tol);

($lat1,$lon1) = $e1.at(45.339403,315.409130,2618.493509,45.478452);
($lat2,$lon2) = $e2.at(45.339403,315.409130,2618.493509,45.478452);
is-approx($lat1, 45.3559203918087, :$rel-tol);
is-approx($lon1, 315.432955775137, :$rel-tol);
is-approx($lat2, 45.3559203918087, :$rel-tol);
is-approx($lon2, -44.5670442248635, :$rel-tol);

($lat1,$lon1) = $e1.at(6.190847,124.992089,3854.030593,133.198367);
($lat2,$lon2) = $e2.at(6.190847,124.992089,3854.030593,133.198367);
is-approx($lat1, 6.16698993482276, :$rel-tol);
is-approx($lon1, 125.017473198902, :$rel-tol);
is-approx($lat2, 6.16698993482276, :$rel-tol);
is-approx($lon2, 125.017473198902, :$rel-tol);

($lat1,$lon1) = $e1.at(-4.121498,262.769582,9308.966888,178.488881);
($lat2,$lon2) = $e2.at(-4.121498,262.769582,9308.966888,178.488881);
is-approx($lat1, -4.205651784836, :$rel-tol);
is-approx($lon1, 262.771793465594, :$rel-tol);
is-approx($lat2, -4.205651784836, :$rel-tol);
is-approx($lon2, -97.2282065344056, :$rel-tol);

($lat1,$lon1) = $e1.at(-4.285155,344.319438,2988.101263,161.216474);
($lat2,$lon2) = $e2.at(-4.285155,344.319438,2988.101263,161.216474);
is-approx($lat1, -4.31073788511537, :$rel-tol);
is-approx($lon1, 344.328105973954, :$rel-tol);
is-approx($lat2, -4.31073788511537, :$rel-tol);
is-approx($lon2, -15.6718940260457, :$rel-tol);

($lat1,$lon1) = $e1.at(51.523602,137.628739,7272.747263,125.320332);
($lat2,$lon2) = $e2.at(51.523602,137.628739,7272.747263,125.320332);
is-approx($lat1, 51.4857783