swestrup: (Default)
swestrup ([personal profile] swestrup) wrote 2003-05-16 02:07 am (UTC)

MatLab vs Mathematica in an Invariant Homolocage!

Don't know too much about MatLab, so I can't say. I've always thought it was more a Engineer's number cruncher than a symbolic math package, so I never looked into it.

As for the speed thing. The only package I am using directly is Miscellaneous`WorldPlot`, which I suspect was written more as a demonstration of cartography than an attempt to do much that is useful. Certainly for simple calculations like 999999! Mathematica takes only a minute or two, so its not necessarily a sluggard.

As for not having found the best functions, decide for yourself. This is the standard Mollweide Projection and its definition in Mathematica's WorldPlot is:
Mollweide =
Module[{th},
(N[{Sqrt[8]/Pi #2 Degree/60 Cos[th],
Sqrt[2] Sin[th]}/.FindRoot[2 th + Sin[2 th] ==
Pi Sin[#1/60 Degree],{th,0}]] )&];


And here is the definition of Eckert IV as well as the code I wrote for it:
EckertIV =
Module[{Theta}, (N[
{ (2/Sqrt[Pi (4+Pi)]) (Degree/60) #2 (1 + Cos[Theta]))
, 2 Sqrt[Pi/(4+Pi) Sin[Theta]
} /.
FindRoot[ Theta + Sin[Theta] Cos[Theta] + 2 Sin[Theta] == (2 +Pi/2) Sin[#1/60 Degree]
, {Theta, 0}
]]) &];


They're almost identical (although I had to clean mine up a bit, since I used greek symbols that didn't translate well into html). They DO do lots of redundant root finding though. A lookup table for Theta would greatly speed things up.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting