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

my $e = Geo::Ellipsoid->new(units=>'degrees');
my( $r, $a );
( $r, $a ) = $e->to(-88.000000, 1.000000,-88.000000, 1.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(-88.000000, 1.000000,-88.000000, 90.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 134.482545961512, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,-88.000000, 179.000000);
delta_ok( $r, 446706.01076052 );
delta_within( $a, 178.999390582928, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,-88.000000, 268.000000);
delta_ok( $r, 324047.278966276 );
delta_within( $a, 223.517433140781, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,0.000000, 1.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,0.000000, 90.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 89.011158607559, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,0.000000, 179.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 177.999150742584, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,0.000000, 268.000000);
delta_ok( $r, 10013675.0566307 );
delta_within( $a, 266.991287566797, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,88.000000, 1.000000);
delta_ok( $r, 19557157.3743612 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,88.000000, 90.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 44.5248574511054, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,88.000000, 179.000000);
delta_ok( $r, 19996176.9000454 );
delta_within( $a, 89.011158607592, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 1.000000,88.000000, 268.000000);
delta_ok( $r, 19696447.0104273 );
delta_within( $a, 313.474906296863, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,-88.000000, 1.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 225.517454038488, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,-88.000000, 90.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(-88.000000, 90.000000,-88.000000, 179.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 134.482545961512, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,-88.000000, 268.000000);
delta_ok( $r, 446706.01076052 );
delta_within( $a, 178.999390582928, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,0.000000, 1.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 270.988841392441, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,0.000000, 90.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,0.000000, 179.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 89.011158607559, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,0.000000, 268.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 177.999150742584, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,88.000000, 1.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 315.475142548895, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,88.000000, 90.000000);
delta_ok( $r, 19557157.3743612 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,88.000000, 179.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 44.5248574511054, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 90.000000,88.000000, 268.000000);
delta_ok( $r, 19996176.9000454 );
delta_within( $a, 89.011158607592, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,-88.000000, 1.000000);
delta_ok( $r, 446706.01076052 );
delta_within( $a, 181.000609417072, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,-88.000000, 90.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 225.517454038488, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,-88.000000, 179.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(-88.000000, 179.000000,-88.000000, 268.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 134.482545961512, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,0.000000, 1.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 182.000849257416, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,0.000000, 90.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 270.988841392441, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,0.000000, 179.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,0.000000, 268.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 89.011158607559, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,88.000000, 1.000000);
delta_ok( $r, 19996176.9000454 );
delta_within( $a, 270.988841392408, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,88.000000, 90.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 315.475142548895, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,88.000000, 179.000000);
delta_ok( $r, 19557157.3743612 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 179.000000,88.000000, 268.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 44.5248574511054, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,-88.000000, 1.000000);
delta_ok( $r, 324047.278966276 );
delta_within( $a, 136.482566859219, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,-88.000000, 90.000000);
delta_ok( $r, 446706.01076052 );
delta_within( $a, 181.000609417072, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,-88.000000, 179.000000);
delta_ok( $r, 313115.736403696 );
delta_within( $a, 225.517454038488, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,-88.000000, 268.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(-88.000000, 268.000000,0.000000, 1.000000);
delta_ok( $r, 10013675.0566307 );
delta_within( $a, 93.0087124332033, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,0.000000, 90.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 182.000849257416, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,0.000000, 179.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 270.988841392441, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,0.000000, 268.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,88.000000, 1.000000);
delta_ok( $r, 19696447.0104273 );
delta_within( $a, 46.5250937031367, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,88.000000, 90.000000);
delta_ok( $r, 19996176.9000454 );
delta_within( $a, 270.988841392408, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,88.000000, 179.000000);
delta_ok( $r, 19685321.6740635 );
delta_within( $a, 315.475142548895, 0.0001 );

( $r, $a ) = $e->to(-88.000000, 268.000000,88.000000, 268.000000);
delta_ok( $r, 19557157.3743612 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,-88.000000, 1.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 180, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,-88.000000, 90.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 177.99357628514, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,-88.000000, 179.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 179.929950967799, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,-88.000000, 268.000000);
delta_ok( $r, 10013675.0566307 );
delta_within( $a, 182.003955421895, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,0.000000, 1.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(0.000000, 1.000000,0.000000, 90.000000);
delta_ok( $r, 9907434.68060135 );
delta_within( $a, 90, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,0.000000, 179.000000);
delta_ok( $r, 19814869.3612027 );
delta_within( $a, 90, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,0.000000, 268.000000);
delta_ok( $r, 10352712.6437744 );
delta_within( $a, 270, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,88.000000, 1.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,88.000000, 90.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 2.00642371485969, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,88.000000, 179.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 0.0700490322014982, 0.0001 );

( $r, $a ) = $e->to(0.000000, 1.000000,88.000000, 268.000000);
delta_ok( $r, 10013675.0566307 );
delta_within( $a, 357.996044578105, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,-88.000000, 1.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 182.00642371486, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,-88.000000, 90.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 180, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,-88.000000, 179.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 177.99357628514, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,-88.000000, 268.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 179.929950967799, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,0.000000, 1.000000);
delta_ok( $r, 9907434.68060135 );
delta_within( $a, 270, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,0.000000, 90.000000);
delta_within( $r, 0, 0.1 );

( $r, $a ) = $e->to(0.000000, 90.000000,0.000000, 179.000000);
delta_ok( $r, 9907434.68060135 );
delta_within( $a, 90, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,0.000000, 268.000000);
delta_ok( $r, 19814869.3612027 );
delta_within( $a, 90, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,88.000000, 1.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 357.99357628514, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,88.000000, 90.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 0, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,88.000000, 179.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 2.00642371485969, 0.0001 );

( $r, $a ) = $e->to(0.000000, 90.000000,88.000000, 268.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 0.0700490322014982, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,-88.000000, 1.000000);
delta_ok( $r, 10225216.6599337 );
delta_within( $a, 180.070049032201, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,-88.000000, 90.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 182.00642371486, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,-88.000000, 179.000000);
delta_ok( $r, 9778578.68718058 );
delta_within( $a, 180, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,-88.000000, 268.000000);
delta_ok( $r, 9998088.45002268 );
delta_within( $a, 177.99357628514, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,0.000000, 1.000000);
delta_ok( $r, 19814869.3612027 );
delta_within( $a, 270, 0.0001 );

( $r, $a ) = $e->to(0.000000, 179.000000,0.000000, 90.000000);
delta_ok