### ----------------------------------------------------
### -- 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: tt/07-location.t
### ----------------------------------------------------
### -- Chunk 1 of 3
#!/usr/local/bin/perl
# Test Geo::Ellipsoid location
use Test::More tests => 400;
use Test::Number::Delta relative => 1e-6;
use Geo::Ellipsoid;
use blib;
use strict;
use warnings;

my $e1 = Geo::Ellipsoid->new(units=>'degrees');
my $e2 = Geo::Ellipsoid->new(units=>'degrees',longitude=>1);
my($lat1,$lon1,$lat2,$lon2,$x,$y);

($lat1, $lon1) = $e1->location(-38.369163,190.874558,533.491111,393.690590);
($lat2, $lon2) = $e2->location(-38.369163,190.874558,533.491111,393.690590);
delta_ok( $lat1, -38.3656166574817 );
delta_ok( $lon1, 190.880662670944 );
delta_ok( $lat2, -38.3656166574817 );
delta_ok( $lon2, -169.119337329056 );

($lat1, $lon1) = $e1->location(-14.608137,30.094655,650.150163,6357.798657);
($lat2, $lon2) = $e2->location(-14.608137,30.094655,650.150163,6357.798657);
delta_ok( $lat1, -14.5506757312212 );
delta_ok( $lon1, 30.1006878108632 );
delta_ok( $lat2, -14.5506757312212 );
delta_ok( $lon2, 30.1006878108632 );

($lat1, $lon1) = $e1->location(-41.623677,208.834416,1603.258290,-147.740698);
($lat2, $lon2) = $e2->location(-41.623677,208.834416,1603.258290,-147.740698);
delta_ok( $lat1, -41.6250052190667 );
delta_ok( $lon1, 208.853654884741 );
delta_ok( $lat2, -41.6250052190667 );
delta_ok( $lon2, -151.146345115259 );

($lat1, $lon1) = $e1->location(-67.726400,52.964864,685.045725,541.410394);
($lat2, $lon2) = $e2->location(-67.726400,52.964864,685.045725,541.410394);
delta_ok( $lat1, -67.72154487153 );
delta_ok( $lon1, 52.9810494838027 );
delta_ok( $lat2, -67.72154487153 );
delta_ok( $lon2, 52.9810494838027 );

($lat1, $lon1) = $e1->location(-5.158991,259.931626,-1709.088383,-4457.450145);
($lat2, $lon2) = $e2->location(-5.158991,259.931626,-1709.088383,-4457.450145);
delta_ok( $lat1, -5.19929911014967 );
delta_ok( $lon1, 259.916209822012 );
delta_ok( $lat2, -5.19929911014967 );
delta_ok( $lon2, -100.083790177988 );

($lat1, $lon1) = $e1->location(-0.582762,29.118576,2827.367632,-828.182160);
($lat2, $lon2) = $e2->location(-0.582762,29.118576,2827.367632,-828.182160);
delta_ok( $lat1, -0.590251306822743 );
delta_ok( $lon1, 29.1439759994689 );
delta_ok( $lat2, -0.590251306822743 );
delta_ok( $lon2, 29.1439759994689 );

($lat1, $lon1) = $e1->location(-26.934636,30.474042,947.389493,291.952216);
($lat2, $lon2) = $e2->location(-26.934636,30.474042,947.389493,291.952216);
delta_ok( $lat1, -26.9320006429192 );
delta_ok( $lon1, 30.4835810246334 );
delta_ok( $lat2, -26.9320006429192 );
delta_ok( $lon2, 30.4835810246334 );

($lat1, $lon1) = $e1->location(-62.773742,62.342057,-7400.407449,3875.891848);
($lat2, $lon2) = $e2->location(-62.773742,62.342057,-7400.407449,3875.891848);
delta_ok( $lat1, -62.738893257913 );
delta_ok( $lon1, 62.197305731553 );
delta_ok( $lat2, -62.738893257913 );
delta_ok( $lon2, 62.197305731553 );

($lat1, $lon1) = $e1->location(68.057252,192.858027,-4489.419161,-1429.203025);
($lat2, $lon2) = $e2->location(68.057252,192.858027,-4489.419161,-1429.203025);
delta_ok( $lat1, 68.0444035490457 );
delta_ok( $lon1, 192.750473587802 );
delta_ok( $lat2, 68.0444035490457 );
delta_ok( $lon2, -167.249526412198 );

($lat1, $lon1) = $e1->location(1.348841,276.378914,2224.789779,-9574.419452);
($lat2, $lon2) = $e2->location(1.348841,276.378914,2224.789779,-9574.419452);
delta_ok( $lat1, 1.26225340172628 );
delta_ok( $lon1, 276.398904775364 );
delta_ok( $lat2, 1.26225340172628 );
delta_ok( $lon2, -83.6010952246363 );

($lat1, $lon1) = $e1->location(27.335146,320.699240,-8535.150724,157.936548);
($lat2, $lon2) = $e2->location(27.335146,320.699240,-8535.150724,157.936548);
delta_ok( $lat1, 27.336544790133 );
delta_ok( $lon1, 320.612989777828 );
delta_ok( $lat2, 27.336544790133 );
delta_ok( $lon2, -39.3870102221718 );

($lat1, $lon1) = $e1->location(34.623205,31.357288,5664.823875,-5632.708719);
($lat2, $lon2) = $e2->location(34.623205,31.357288,5664.823875,-5632.708719);
delta_ok( $lat1, 34.5724140545376 );
delta_ok( $lon1, 31.4190231012302 );
delta_ok( $lat2, 34.5724140545376 );
delta_ok( $lon2, 31.4190231012302 );

($lat1, $lon1) = $e1->location(-6.856999,130.887597,-4447.965929,-6362.641019);
($lat2, $lon2) = $e2->location(-6.856999,130.887597,-4447.965929,-6362.641019);
delta_ok( $lat1, -6.91453101371976 );
delta_ok( $lon1, 130.847349224089 );
delta_ok( $lat2, -6.91453101371976 );
delta_ok( $lon2, 130.847349224089 );

($lat1, $lon1) = $e1->location(-70.754141,43.777574,-4660.663331,-3114.520427);
($lat2, $lon2) = $e2->location(-70.754141,43.777574,-4660.663331,-3114.520427);
delta_ok( $lat1, -70.7820124418521 );
delta_ok( $lon1, 43.6507601360177 );
delta_ok( $lat2, -70.7820124418521 );
delta_ok( $lon2, 43.6507601360177 );

($lat1, $lon1) = $e1->location(-69.865357,188.114494,7057.333326,4623.928963);
($lat2, $lon2) = $e2->location(-69.865357,188.114494,7057.333326,4623.928963);
delta_ok( $lat1, -69.8238139675753 );
delta_ok( $lon1, 188.297759634022 );
delta_ok( $lat2, -69.8238139675753 );
delta_ok( $lon2, -171.702240365978 );

($lat1, $lon1) = $e1->location(-79.523730,324.065787,2004.841971,835.056246);
($lat2, $lon2) = $e2->location(-79.523730,324.065787,2004.841971,835.056246);
delta_ok( $lat1, -79.5162359949416 );
delta_ok( $lon1, 324.164444728713 );
delta_ok( $lat2, -79.5162359949416 );
delta_ok( $lon2, -35.8355552712871 );

($lat1, $lon1) = $e1->location(74.606774,294.646962,-3726.786136,-6044.735429);
($lat2, $lon2) = $e2->location(74.606774,294.646962,-3726.786136,-6044.735429);
delta_ok( $lat1, 74.552581484185 );
delta_ok( $lon1, 294.521662695934 );
delta_ok( $lat2, 74.552581484185 );
delta_ok( $lon2, -65.4783373040659 );

($lat1, $lon1) = $e1->location(28.972667,278.549276,2282.396343,457.952283);
($lat2, $lon2) = $e2->location(28.972667,278.549276,2282.396343,457.952283);
delta_ok( $lat1, 28.9767972109023 );
delta_ok( $lon1, 278.572694719835 );
delta_ok( $lat2, 28.9767972109023 );
delta_ok( $lon2, -81.4273052801652 );

($lat1, $lon1) = $e1->location(-20.359063,296.599967,-1055.268135,-1240.723925);
($lat2, $lon2) = $e2->location(-20.359063,296.599967,-1055.268135,-1240.723925);
delta_ok( $lat1, -20.3702696544288 );
delta_ok( $lon1, 296.589859316515 );
delta_ok( $lat2, -20.3702696544288 );
delta_ok( $lon2, -63.4101406834851 );

($lat1, $lon1) = $e1->location(-60.365048,156.813021,-1.250697,-10.735742);
($lat2, $lon2) = $e2->location(-60.365048,156.813021,-1.250697,-10.735742);
delta_ok( $lat1, -60.3651441594277 );
delta_ok( $lon1, 156.812997908757 );
delta_ok( $lat2, -60.3651441594277 );
delta_ok( $lon2, 156.812997908757 );

($lat1, $lon1) = $e1->location(-6.203945,247.684632,182.386266,-268.728800);
($lat2, $lon2) = $e2->location(-6.203945,247.684632,182.386266,-268.728800);
delta_ok( $lat1, -6.20637500756398 );
delta_ok( $lon1, 247.686280489375 );
delta_ok( $lat2, -6.20637500756398 );
delta_ok( $lon2, -112.313719510625 );

($lat1, $lon1) = $e1->location(0.611947,100.746342,7512.264392,-6560.959753);
($lat2, $lon2) = $e2->location(0.611947,100.746342,7512.264392,-6560.959753);
delta_ok( $lat1, 0.55261091016823 );
delta_ok( $lon1, 100.813828549171 );
delta_ok( $lat2, 0.55261091016823 );
delta_ok( $lon2, 100.813828549171 );

($lat1, $lon1) = $e1->location(-20.725615,342.386744,-538.867522,-614.748871);
($lat2, $lon2) = $e2->location(-20.725615,342.386744,-538.867522,-614.748871);
delta_ok( $lat1, -20.7311674916701 );
delta_ok( $lon1, 342.381570767838 );
delta_ok( $lat2, -20.7311674916701 );
delta_ok( $lon2, -17.6184292321621 );

($lat1, $lon1) = $e1->location(46.911457,128.191393,8859.825337,3981.362304);
($lat2, $lon2) = $e2->location(46.911457,128.191393,8859.825337,3981.362304);
delta_ok( $lat1, 46.9472109419573 );
delta_ok( $lon1, 128.307769547944 );
delta_ok( $lat2, 46.9472109419573 );
delta_ok( $lon2, 128.307769547944 );

($lat1, $lon1) = $e1->location(-11.235004,282.756437,-247.423508,-1148.832859);
($lat2, $lon2) = $e2->location(-11.235004,282.756437,-247.423508,-1148.832859);
delta_ok( $lat1, -11.2453901777647 );
delta_ok( $lon1, 282.754171348951 );
delta_ok( $lat2, -11.2453901777647 );
delta_ok( $lon2, -77.2458286510488 );

($lat1, $lon1) = $e1->location(-41.167125,221.956378,7098.529445,3165.704607);
($lat2, $lon2) = $e2->location(-41.167125,221.956378,7098.529445,3165.704607);
delta_ok( $lat1, -41.1385887169891 );
delta_ok( $lon1, 222.040925759323 );
delta_ok( $lat2, -41.1385887169891 );
delta_ok( $lon2, -137.959074240677 );

($lat1, $lon1) = $e1->location(-1.549886,336.466532,2432.164382,-2003.196884);
($lat2, $lon2) = $e2->location(-1.549886,336.466532,2432.164382,-2003.196884);
delta_ok( $lat1, -1.56800166865689 );
delta_ok( $lon1, 336.48838856866 );
delta_ok( $lat2, -1.56800166865689 );
delta_ok( $lon2, -23.5116114313395 );

($lat1, $lon1) = $e1->location(-63.776699,134.057987,-5461.071096,7031.399910);
($lat2, $lon2) = $e2->location(-63.776699,134.057987,-5461.071096,7031.399910);
delta_ok( $lat1, -63.7135798907925 );
delta_ok( $lon1, 133.947510160671 );
delta_ok( $lat2, -63.7135798907925 );
delta_ok( $lon2, 133.947510160671 );

($lat1, $lon1) = $e1->location(77.940951,38.523563,-588.281719,1372.291090);
($lat2, $lon2) = $e2->location(77.940951,38.523563,-588.281719,1372.291090);
delta_ok( $lat1, 77.9532419255974 );
delta_ok( $lon1, 38.4983240629321 );
delta_ok( $lat2, 77.9532419255974 );
delta_ok( $lon2, 38.4983240629321 );

($lat1, $lon1) = $e1->location(45.339403,315.409130,1866.951314,1836.028607);
($lat2, $lon2) = $e2->location(45.339403,315.409130,1866.951314,1836.028607);
delta_ok( $lat1, 45.3559203918087 );
delta_ok( $lon1, 315.432955775137 );
delta_ok( $lat2, 45.3559203918087 );
delta_ok( $lon2, -44.5670442248635 );

($lat1, $lon1) = $e1->location(6.190847,124.992089,2809.542582,-2638.185417);
($lat2, $lon2) = $e2->location(6.190847,124.992089,2809.542582,-2638.185417);
delta_ok( $lat1, 6.16698993482276 );
delta_ok( $lon1, 125.017473198902 );
delta_ok( $lat2, 6.16698993482276 );
delta_ok( $lon2, 125.017473198902 );

($lat1, $lon1) = $e1->location(-4.121498,262.769582,245.486247,-9305.729473);
($lat2, $lon2) = $e2->location(-4.121498,262.769582,245.486247,-9305.729473);
delta_ok( $lat1, -4.205651784836 );
delta_ok( $lon1, 262.771793465594 );
delta_ok( $lat2, -4.205651784836 );
delta_ok( $lon2, -97.2282065344056 );

($lat1, $lon1) = $e1->location(-4.285155,344.319438,962.149187,-2828.960604);
($lat2, $lon2) = $e2->location(-4.285155,344.319438,962.149187,-2828.960604);
delta_ok( $lat1, -4.31073788511537 );
delta_ok( $lon1, 344.328105973954 );
delta_ok( $lat2, -4.31073788511537 );
delta_ok( $lon2, -15.6718940260457 );

($lat1, $lon1) = $e1->location(51.523602,137.628739,5934.070688,-4204.718518);
($lat2, $lon2) = $e2->location(51.523602,137.628739,5934.070688,-4204.718518);
delta_ok( $lat1, 51.4857783969849 );
delta_ok( $lon1, 137.714167388512 );
delta_ok( $lat2, 51.4857783969849 );
delta_ok( $lon2, 137.714167388512 );

($lat1, $lon1) = $e1->location(25.726049,310.324628,-6257.928111,2250.854111);
($lat2, $lon2) = $e2->location(25.726049,310.324628,-6257.928111,2250.854111);
delta_ok( $lat1, 25.7463533347373 );
delta_ok( $lon1, 310.262255281203 );
delta_ok( $lat2, 25.7463533347373 );
delta_ok( $lon2, -49.7377447187972 );

($lat1, $lon1) = $e1->location(68.128342,115.791221,-2001.180839,-4332.668684);
($lat2, $lon2) = $e2->location(68.128342,115.791221,-2001.180839,-4332.668684);
delta_ok( $lat1, 68.0894895788839 );
delta_ok( $lon1, 115.743184646015 );
delta_ok( $lat2, 68.0894895788839 );
delta_ok( $lon2, 115.743184646015 );

($lat1, $lon1) = $e1->location(-11.919645,340.641713,400.975087,-796.364784);
($lat2, $lon2) = $e2->location(-11.919645,340.641713,400.975087,-796.364784);
delta_ok( $lat1, -11.9268441615802 );
delta_ok( $lon1, 340.645393779515 );
delta_ok( $lat2, -11