<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD><TITLE>Re: [Proj] Transverse Mercator algorithm with good accuracy/speedtrade-off?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Many thanks for all good advice. This is quite a
friendly</FONT> </SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">and knowledgeable mailing list. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">I have looked at Dozier's paper now (thanks to Melita Kennedy
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008></SPAN><SPAN
class=527525508-26052008><FONT face="Courier New">for the link), and a summary
of Poder-Engsager (thanks to </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">daan Strebe). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008></SPAN><SPAN
class=527525508-26052008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Actually, I had hoped that the Snyder/tmerc approach (or
should </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">I say Gauss </FONT></SPAN><FONT face="Courier New"><SPAN
class=527525508-26052008>approach) could be </SPAN><SPAN
class=527525508-26052008>improved with just one or two more</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>extra terms in the series </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>expansions. But my
understanding </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008></SPAN><SPAN class=527525508-26052008>from Dozier's
background text (and from Clifford </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>Mugnier's
mails</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>in the January 2003 archives), </SPAN><SPAN
class=527525508-26052008>is now that it takes quite </SPAN></FONT><SPAN
class=527525508-26052008><FONT face="Courier New">at lot </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">of extra terms to get just slightly wider zones of accuracy.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">On the other hand, I find it hard to believe that Dozier's
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">iterative </FONT></SPAN><SPAN class=527525508-26052008><FONT
face="Courier New">algorithm is </FONT></SPAN><SPAN
class=527525508-26052008><FONT face="Courier New">faster <SPAN
class=527525508-26052008>than </SPAN></FONT></SPAN><SPAN
class=527525508-26052008><SPAN class=527525508-26052008><FONT
face="Courier New">the Krüger formulas from 1912</FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><SPAN
class=527525508-26052008><FONT face=Arial><</FONT><A
href="http://www.lantmateriet.se/upload/filer/kartor/geodesi_gps_och_detaljmatning/geodesi/Formelsamling/Gauss_Conformal_Projection.pdf"><FONT
face="Courier New">http://www.lantmateriet.se/upload/filer/kartor/geodesi_gps_och_detaljmatning/geodesi/Formelsamling/Gauss_Conformal_Projection.pdf</FONT></A><FONT
face=Arial>></FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">As a simple comparison, I tried to count the number of
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">transcendental </FONT></SPAN><SPAN
class=527525508-26052008><FONT face="Courier New">function </FONT></SPAN><FONT
face="Courier New"><SPAN class=527525508-26052008>calls (TFCs) that will be made
at </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>run-time. </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>I am counting
</SPAN></FONT><FONT face="Courier New"><SPAN class=527525508-26052008>sin() and
cos() of the </SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>same argument</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008></SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>as one TFC, and likewise </SPAN><SPAN
class=527525508-26052008>for sinh() and </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>cosh(). </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>I have also assumed
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008></SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>a few simple </SPAN><SPAN
class=527525508-26052008>optimizations </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>(for example,
</SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>multiple-angle </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>formulas </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008></SPAN><SPAN class=527525508-26052008>can be
u</SPAN><SPAN class=527525508-26052008>sed instead </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>of evaluating sin(2t),
sin(3t), sin(4t), ...). </SPAN></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">My results are (no warranties expressed or implied):
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Num. of TFCs forw. inverse
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">tmerc
1 1+m (m = number of iterations in
pj_inv_mlfn, usually 1 or 2). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Krüger
6 6</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Poder-Engsager 7
? (see footnote)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Dozier
6+6n 6+4n (n = number of iterations in cnewton, at least
1). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>So I would expect Krüger and Poder-Engsager to
have about the </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>same speed, </SPAN></FONT><FONT
face="Courier New"><SPAN class=527525508-26052008>and </SPAN><SPAN
class=527525508-26052008>Dozier to </SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>be at least twice as slow. But of course,
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New"><SPAN
class=527525508-26052008>t</SPAN><SPAN class=527525508-26052008>he ESRI
</SPAN></FONT><FONT face="Courier New"><SPAN
class=527525508-26052008>people may have done clever optimizations
</SPAN></FONT><SPAN class=527525508-26052008><FONT face="Courier New">of
Dozier's </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">algorithm. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT face="Courier New">
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">For my own part, though, I think I may try to speed
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">up my Krüger </FONT></SPAN><SPAN
class=527525508-26052008><FONT face="Courier New">implementation a little more.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><SPAN
class=527525508-26052008><FONT face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Again, many thanks for all advice.
</FONT></SPAN></DIV></SPAN></DIV></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"></FONT></SPAN> </DIV></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">Footnote: For Poder-Engsager (recommended by daan Strebe),
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">I did </FONT></SPAN><SPAN class=527525508-26052008><FONT
face="Courier New">not </FONT></SPAN><SPAN class=527525508-26052008><FONT
face="Courier New">find </FONT></SPAN><SPAN class=527525508-26052008><FONT
face="Courier New">the </FONT></SPAN><SPAN class=527525508-26052008><FONT
face="Courier New">original source, </FONT></SPAN><SPAN
class=527525508-26052008><FONT face="Courier New">only formulas for the
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">forward direction given in </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><A
href="http://www.fofodala.dk/projekter/9sem/2004_Flaadestyring_Himmerlands_Elforsyning.pdf"><FONT
face="Courier New">http://www.fofodala.dk/projekter/9sem/2004_Flaadestyring_Himmerlands_Elforsyning.pdf</FONT></A><FONT
face="Courier New">, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New">where credit is given to </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"> Knud Poder and Karsten Engsager:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"> Some Conformal Mappings and Transformations
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"> for Geodesy and Topographic
Cartography,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527525508-26052008><FONT
face="Courier New"> KMS (Kort & Matrikelstyrelsen, Denmark) 1998.
</FONT></SPAN></DIV><!-- Converted from text/plain format -->
<P><FONT face="Courier New">--<BR>Mikael Rittri<BR>Carmenta AB<BR>Box
11354<BR>SE-404 28 Göteborg<BR>Visitors: Sankt Eriksgatan 5<BR>SWEDEN<BR>Tel:
+46-31-775 57 37<BR>Mob: +46-703-60 34
07<BR>mikael.rittri@carmenta.com<BR>www.carmenta.com </FONT></P></BODY></HTML>