#!./perl
#
# Regression tests for the Math::Trig package
#
# The tests are quite modest as the Math::Complex tests exercise
# these quite vigorously.
#
# -- Jarkko Hietaniemi, April 1997
BEGIN {
chdir 't' if -d 't';
}
use strict;
$eps = 1e-10;
}
print "# near? $_[0] $_[1] $e\n";
}
print "1..29\n";
$x = 0.9;
print "ok 1\n";
print "ok 2\n";
print "ok 3\n";
$x = asin(2);
print "ok 4\n";
# avoid using Math::Complex here
$x =~ /^([^-]+)(-[^i]+)i$/;
($y, $z) = ($1, $2);
print "ok 5\n";
print "ok 6\n";
print "ok 7\n";
{
print "ok 8\n";
print "ok 9\n";
print "ok 10\n";
print "ok 11\n";
}
{
print "ok 12\n";
print "ok 13\n";
print "ok 14\n";
print "ok 15\n";
}
{
print "ok 16\n";
print "ok 17\n";
}
{
print 'not '
print "ok 18\n";
print 'not '
print "ok 19\n";
# London to Tokyo.
print "ok 20\n";
}
{
my $R2D = 57.295779513082320876798154814169;
print "ok 21\n";
print "ok 22\n";
print "ok 23\n";
}
{
print 'not '
print "ok 24\n";
# Retired test: Relies on atan(0, 0), which is not portable.
# print 'not '
# unless (near(great_circle_direction(0, 0, pi, pi), -pi()/2));
print "ok 25\n";
print 'not '
31.791945393073));
print "ok 26\n";
print 'not '
336.069766430326));
print "ok 27\n";
print 'not '
246.800348034667));
print "ok 28\n";
print 'not '
58.2079877553156));
print "ok 29\n";
}
# eof