Little Accomplishments.
May. 15th, 2003 01:39 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So, a few weeks ago I acquired a copy of Mathematica, and I've been taking the occasional free moment now and then to try and figure out if its as nifty as folks say. I'm beginning to think it is. Yesterday I managed to update the WorldPlot module with the necessary transformations to plot Eckert IV Equal Area maps. Its extra nifty when you realize the transformations are non-analytic. Anyway, I can now get an Eckert map of the world in about 9 seconds of compute.
The reason this is important to me is that I've drawn all my RPG world maps in Eckert format and had no idea how to transform them into a globe or some other view. Now I'm fairly confident that I can write something that does the reverse transforms (which thankfully ARE analytic) and then reproject my world in any desired map format. Oh, and I'm sure I can get that 8 second delay down below 1/4 second. After all there is NO evidence that the WorldPlot routines were written with speed in mind.
The reason this is important to me is that I've drawn all my RPG world maps in Eckert format and had no idea how to transform them into a globe or some other view. Now I'm fairly confident that I can write something that does the reverse transforms (which thankfully ARE analytic) and then reproject my world in any desired map format. Oh, and I'm sure I can get that 8 second delay down below 1/4 second. After all there is NO evidence that the WorldPlot routines were written with speed in mind.
MatLab vs Mathematica in an Invariant Homolocage!
Date: 2003-05-16 02:07 am (UTC)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.