Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to use rad2rad

by Athanasius (Chancellor)
on Jan 26, 2013 at 15:40 UTC ( #1015502=note: print w/replies, xml ) Need Help??


in reply to How to use rad2rad

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,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: How to use rad2rad
by Masayoshi Fujimoto (Initiate) on Jan 26, 2013 at 16:19 UTC
    Good example. Thank you very much.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015502]
help
Chatterbox?
[Corion]: marto: Ow! You got hit by the storm that is bringing warm weather to me ...
[1nickt]: marto Good to hear that was the worst of it for you...
[marto]: 1nickt the worst I'm aware of at the moment :P
LanX .♩..♬ ... Another one bites the Sahara dust ...
marto wonders what fresh hell the firefox update has brought, apart from maxing out CPUs

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-10-17 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (230 votes). Check out past polls.

    Notices?