|
|
| There's more than one way to do things | |
| PerlMonks |
Re: Code refactoring: simple trig, but it's been so long.by tachyon (Chancellor) |
| on Dec 30, 2004 at 02:08 UTC ( #418156=note: print w/ replies, xml ) | Need Help?? |
|
Evidently you feel more comfortable using degrees rather than radians but the conversion to and from radians<->degrees serves no real purpose. Just define:
You will get a division by zero crash in the case where $x and $y = 0 as it will fall through your 'extreme cases'. You can remove the dependency on a module by using radians and using a function for atan() like:
cheers tachyon
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||