### ----------------------------------------------------
### -- 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/05-to.t
### ----------------------------------------------------
### -- Chunk 1 of 5
# Test Geo::Ellipsoid to

use v6;
use Test;

plan 476;

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)
#   delta_within => is-approx($a, $b, :abs-tol<?>)
#
#  From the Perl 5 test file:
#    use Test::Number::Delta relative => 1e-6;
#  which translates to:
my $rel-tol = 1e-6;

my $e = Geo::Ellipsoid.new(units=>'degrees');
my ($r, $a);

($r, $a) = $e.to(-88.000000, 1.000000,-88.000000, 1.000000);
is-approx($r, 0, :abs-tol<0.1>); #delta_within($r, 0, 0.1);

($r, $a) = $e.to(-88.000000, 1.000000,-88.000000, 90.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 134.482545961512, :abs-tol<0.0001>); #delta_within($a, 134.482545961512, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,-88.000000, 179.000000);
is-approx($r, 446706.01076052, :$rel-tol); # perl 5: delta_ok
is-approx($a, 178.999390582928, :abs-tol<0.0001>); #delta_within($a, 178.999390582928, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,-88.000000, 268.000000);
is-approx($r, 324047.278966276, :$rel-tol); # perl 5: delta_ok
is-approx($a, 223.517433140781, :abs-tol<0.0001>); #delta_within($a, 223.517433140781, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,0.000000, 1.000000);
is-approx($r, 9778578.68718058, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,0.000000, 90.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 89.011158607559, :abs-tol<0.0001>); #delta_within($a, 89.011158607559, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,0.000000, 179.000000);
is-approx($r, 10225216.6599337, :$rel-tol); # perl 5: delta_ok
is-approx($a, 177.999150742584, :abs-tol<0.0001>); #delta_within($a, 177.999150742584, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,0.000000, 268.000000);
is-approx($r, 10013675.0566307, :$rel-tol); # perl 5: delta_ok
is-approx($a, 266.991287566797, :abs-tol<0.0001>); #delta_within($a, 266.991287566797, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,88.000000, 1.000000);
is-approx($r, 19557157.3743612, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,88.000000, 90.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 44.5248574511054, :abs-tol<0.0001>); #delta_within($a, 44.5248574511054, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,88.000000, 179.000000);
is-approx($r, 19996176.9000454, :$rel-tol); # perl 5: delta_ok
is-approx($a, 89.011158607592, :abs-tol<0.0001>); #delta_within($a, 89.011158607592, 0.0001);

($r, $a) = $e.to(-88.000000, 1.000000,88.000000, 268.000000);
is-approx($r, 19696447.0104273, :$rel-tol); # perl 5: delta_ok
is-approx($a, 313.474906296863, :abs-tol<0.0001>); #delta_within($a, 313.474906296863, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,-88.000000, 1.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 225.517454038488, :abs-tol<0.0001>); #delta_within($a, 225.517454038488, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,-88.000000, 90.000000);
is-approx($r, 0, :abs-tol<0.1>); #delta_within($r, 0, 0.1);

($r, $a) = $e.to(-88.000000, 90.000000,-88.000000, 179.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 134.482545961512, :abs-tol<0.0001>); #delta_within($a, 134.482545961512, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,-88.000000, 268.000000);
is-approx($r, 446706.01076052, :$rel-tol); # perl 5: delta_ok
is-approx($a, 178.999390582928, :abs-tol<0.0001>); #delta_within($a, 178.999390582928, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,0.000000, 1.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 270.988841392441, :abs-tol<0.0001>); #delta_within($a, 270.988841392441, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,0.000000, 90.000000);
is-approx($r, 9778578.68718058, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,0.000000, 179.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 89.011158607559, :abs-tol<0.0001>); #delta_within($a, 89.011158607559, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,0.000000, 268.000000);
is-approx($r, 10225216.6599337, :$rel-tol); # perl 5: delta_ok
is-approx($a, 177.999150742584, :abs-tol<0.0001>); #delta_within($a, 177.999150742584, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,88.000000, 1.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 315.475142548895, :abs-tol<0.0001>); #delta_within($a, 315.475142548895, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,88.000000, 90.000000);
is-approx($r, 19557157.3743612, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,88.000000, 179.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 44.5248574511054, :abs-tol<0.0001>); #delta_within($a, 44.5248574511054, 0.0001);

($r, $a) = $e.to(-88.000000, 90.000000,88.000000, 268.000000);
is-approx($r, 19996176.9000454, :$rel-tol); # perl 5: delta_ok
is-approx($a, 89.011158607592, :abs-tol<0.0001>); #delta_within($a, 89.011158607592, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,-88.000000, 1.000000);
is-approx($r, 446706.01076052, :$rel-tol); # perl 5: delta_ok
is-approx($a, 181.000609417072, :abs-tol<0.0001>); #delta_within($a, 181.000609417072, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,-88.000000, 90.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 225.517454038488, :abs-tol<0.0001>); #delta_within($a, 225.517454038488, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,-88.000000, 179.000000);
is-approx($r, 0, :abs-tol<0.1>); #delta_within($r, 0, 0.1);

($r, $a) = $e.to(-88.000000, 179.000000,-88.000000, 268.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 134.482545961512, :abs-tol<0.0001>); #delta_within($a, 134.482545961512, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,0.000000, 1.000000);
is-approx($r, 10225216.6599337, :$rel-tol); # perl 5: delta_ok
is-approx($a, 182.000849257416, :abs-tol<0.0001>); #delta_within($a, 182.000849257416, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,0.000000, 90.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 270.988841392441, :abs-tol<0.0001>); #delta_within($a, 270.988841392441, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,0.000000, 179.000000);
is-approx($r, 9778578.68718058, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,0.000000, 268.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 89.011158607559, :abs-tol<0.0001>); #delta_within($a, 89.011158607559, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,88.000000, 1.000000);
is-approx($r, 19996176.9000454, :$rel-tol); # perl 5: delta_ok
is-approx($a, 270.988841392408, :abs-tol<0.0001>); #delta_within($a, 270.988841392408, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,88.000000, 90.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 315.475142548895, :abs-tol<0.0001>); #delta_within($a, 315.475142548895, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,88.000000, 179.000000);
is-approx($r, 19557157.3743612, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 179.000000,88.000000, 268.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 44.5248574511054, :abs-tol<0.0001>); #delta_within($a, 44.5248574511054, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,-88.000000, 1.000000);
is-approx($r, 324047.278966276, :$rel-tol); # perl 5: delta_ok
is-approx($a, 136.482566859219, :abs-tol<0.0001>); #delta_within($a, 136.482566859219, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,-88.000000, 90.000000);
is-approx($r, 446706.01076052, :$rel-tol); # perl 5: delta_ok
is-approx($a, 181.000609417072, :abs-tol<0.0001>); #delta_within($a, 181.000609417072, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,-88.000000, 179.000000);
is-approx($r, 313115.736403696, :$rel-tol); # perl 5: delta_ok
is-approx($a, 225.517454038488, :abs-tol<0.0001>); #delta_within($a, 225.517454038488, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,-88.000000, 268.000000);
is-approx($r, 0, :abs-tol<0.1>); #delta_within($r, 0, 0.1);

($r, $a) = $e.to(-88.000000, 268.000000,0.000000, 1.000000);
is-approx($r, 10013675.0566307, :$rel-tol); # perl 5: delta_ok
is-approx($a, 93.0087124332033, :abs-tol<0.0001>); #delta_within($a, 93.0087124332033, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,0.000000, 90.000000);
is-approx($r, 10225216.6599337, :$rel-tol); # perl 5: delta_ok
is-approx($a, 182.000849257416, :abs-tol<0.0001>); #delta_within($a, 182.000849257416, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,0.000000, 179.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 270.988841392441, :abs-tol<0.0001>); #delta_within($a, 270.988841392441, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,0.000000, 268.000000);
is-approx($r, 9778578.68718058, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,88.000000, 1.000000);
is-approx($r, 19696447.0104273, :$rel-tol); # perl 5: delta_ok
is-approx($a, 46.5250937031367, :abs-tol<0.0001>); #delta_within($a, 46.5250937031367, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,88.000000, 90.000000);
is-approx($r, 19996176.9000454, :$rel-tol); # perl 5: delta_ok
is-approx($a, 270.988841392408, :abs-tol<0.0001>); #delta_within($a, 270.988841392408, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,88.000000, 179.000000);
is-approx($r, 19685321.6740635, :$rel-tol); # perl 5: delta_ok
is-approx($a, 315.475142548895, :abs-tol<0.0001>); #delta_within($a, 315.475142548895, 0.0001);

($r, $a) = $e.to(-88.000000, 268.000000,88.000000, 268.000000);
is-approx($r, 19557157.3743612, :$rel-tol); # perl 5: delta_ok
is-approx($a, 0, :abs-tol<0.0001>); #delta_within($a, 0, 0.0001);

($r, $a) = $e.to(0.000000, 1.000000,-88.000000, 1.000000);
is-approx($r, 9778578.68718058, :$rel-tol); # perl 5: delta_ok
is-approx($a, 180, :abs-tol<0.0001>); #delta_within($a, 180, 0.0001);

($r, $a) = $e.to(0.000000, 1.000000,-88.000000, 90.000000);
is-approx($r, 9998088.45002268, :$rel-tol); # perl 5: delta_ok
is-approx($a, 177.99357628514, :abs-tol<0.0001>); #delta_within($a, 177.99357628514, 0.0001);

($r, $a) = $e.to(0.000000, 1.000000,-88.000000, 179.000000);
is-approx($r, 10225216.6599337, :$rel-tol); # perl 5: delta_ok
is-approx($a, 179.929950967799, :abs-tol<0.0001>); #delta_within($a, 179.929950967799, 0.0001);

($r, $a) = $e.to(0.000000, 1.000000,-88.000000, 268.000000);
is-approx($r, 10013675.0566307, :$rel-tol); # perl 5: delta_ok
is-approx($a, 182.003955421895, :abs-tol<0.0001>); #delta_within($a, 182.003955421895, 0.0001);

($r, $a) = $e.to(0.000000, 1.000000,0.000000, 1.000000);
is-approx($r, 0, :abs-tol<0.1>); #delta_within($r, 0, 0.1);

($r, $a) = $e.to(0.000000, 1.000000,0.000000, 90.000000);
is-approx($r, 9907434.68060135, :$rel-tol); # perl 5: delta_ok
is-approx($a, 90, :abs-tol<0.0001>); #delta_within($