Hello Masayoshi Fujimoto, and welcome to the Monastery!
The function rad2rad is not exported by the Math::Trig module, so to use it you need to put the full module name in front:
my $radians_wrapped_by_2pi = Math::Trig::rad2rad($radians);
Update: Here is an example of rad2rad() in use:
use Modern::Perl;
use Math::Trig ':pi';
my $radians = 4.5 * pi;
my $radians_wrapped_by_2pi = Math::Trig::rad2rad($radians);
say 'rad2rad(', $radians, ') = ', $radians_wrapped_by_2pi;
Output:
1:49 >perl 502_SoPW.pl
rad2rad(14.1371669411541) = 1.5707963267949
1:49 >
Hope that helps,
|