Hi Daisuke,
Daisuke Maki wrote:
> I'm fairly sure this is ok, but as I did it in such a hurry, can you
> just download this and double check for me before I upload it to CPAN?
>
> http://www.wafu.ne.jp/~daisuke/DateTime-Util-Calc-0.03.tar.gz
>
Wait!!! I was going to ask you to add some functions to this module.
like:
sub atan2d {
( $RADEG * atan2( $_[0], $_[1] ) );
}
sub revolution {
#
#
# FUNCTIONAL SEQUENCE for revolution
#
# _GIVEN
# any angle
#
# _THEN
#
# reduces any angle to within the first revolution
# by subtracting or adding even multiples of 360.0
#
#
# _RETURN
#
# the value of the input is >= 0.0 and < 360.0
#
my $x = $_[0];
return ( $x - 360.0 * floor( $x * $INV360 ) );
}
sub rev180 {
#
#
# FUNCTIONAL SEQUENCE for rev180
#
# _GIVEN
#
# any angle
#
# _THEN
#
# Reduce input to within +180..+180 degrees
#
#
# _RETURN
#
# angle that was reduced
#
my ($x) = @_;
return ( $x - 360.0 * floor( $x * $INV360 + 0.5 ) );
}
The names can be whatever you like (as long as I
know what they are).
I will download and test and let you know
> BTW, DT::U::Calc uses Math::BigFloat's, which are
> significantly slower
> than just straight forward calculation. is that okay with you?
As long as it works :)
Ron Hill
>
> Daisuke Maki wrote:
>
>>
>> That would be because I'm stupid and blindly copied sin_deg(),
>> cos_deg() to asin_deg() and acos_deg().
>>
>> Fix coming...
>>
>> --d