hjw wrote:sub RotOrbits {
well, to lazy to use prototypes. If called with the wrong number of arguments it fails badly.local(...) = @_;
well, you should use "my" instead of "local". And I hope that it is NOT necessary to tell why!
This is an ugly piece of code, honestly. The math may be ok. The coding is not professional. At least not by my standards. Sorry to say this.
Horst.
That's just crazy! Look up e.g the "Perl bible" (Programming Perl, Larry Wall & Randal L. Schwartz, O'Reilly) on page 100 ff...
I am 99% sure that I code Perl decades longer than you do...
[When Perl5 appeared in '94 (with object oriented features and all that), I had heavily used Perl already for about 6 years. That's why I often tend to hack things with 'local' instead of scoping with 'my'. Of course, I am aware that 'local' is 90% history by now]
Yes I am a scientist in theoretical physics not a professional coder. Yet my Perl know-how has never been inadequate for any of my very sophisticated professional needs. I typically code things for Celestia very quickly after a > 12 h working day. No time for "beautifications". This code is only used by myself, no "stupid" users will ever see it. Good enough and certainly correct.
And after you tried a bit to derive the trig formulae for yourself, you will for sure realize that they are the much harder part of the task! It's the signs that cause the headache! Coding the formulae in Perl is comparatively trivial...
Honestly, your post above was entirely superfluous and "out of bounds". Why don't you first show us a bit what /you/ can do. Then we'll see...
My "unprofessional" Perl scripts have provided to the Celestia community:
-- 40000+ Earth locations (used by virtually everyone),
-- the world's complete list of capitals,
-- weight optimized, non-overlapping label distributions of locations on Mars, Earth Mercury, Venus etc,
-- thousands of binary orbits extracted from professional catalogs
Just to name a few ... Come on, relax!
Bye Fridger