Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How can I get sine, cosine, and tangent to return values in degrees?

by barrachois (Pilgrim)
on Dec 30, 2002 at 21:01 UTC ( [id://223177]=note: print w/replies, xml ) Need Help??


in reply to How can I get sine, cosine, and tangent to return values in degrees?

Rather than have a line like this
my $pi = 3.14159265358979;
which requires you to choose how many digits of pi you (or your operating system) want, and even may require (for some, at least) that you look up the value of pi, I would suggest that a line like this instead will do the right thing.
my $pi = 4*atan2(1,1);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://223177]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found