Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(redmist) Re: Trig in Perl

by redmist (Deacon)
on Sep 04, 2001 at 11:54 UTC ( #109988=note: print w/replies, xml ) Need Help??


in reply to Trig in Perl

There are many style issues (indentation, variable naming schemes) that I would change, but the thing that would probably help you most would be to use Perl's built-in trigonometry operators: cos, sin, atan2, etc. Also, you might want to get rid of sub_haiku(), opting for Carp or warn and die. Also use constant PI => 3.14159 would be a more proper way to define pi that $pi = 3.141.

Beyond that, I don't know what to tell you. Through experience (as long as you care about doing things elegantly and efficiently), you will learn how to shorten code and make it look (and be) cleaner and sexier.

redmist
Purple Monkey Dishwasher

Replies are listed 'Best First'.
Re: (redmist) Re: Trig in Perl
by Hofmator (Curate) on Sep 04, 2001 at 12:58 UTC

    Also, you might want to get rid of sub_haiku(), opting for Carp or warn and die.
    Or use Damian Conways's Coy to die with style and haiku ;-)

    -- Hofmator

      <html><body>

      Thanks for that, I'll try them out as I had not heard of them before :)

      Dr Lambado

      </body></html>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2019-05-20 21:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (129 votes). Check out past polls.

    Notices?