[gradsusr] Possible error in gxwmap.c

Vello Loorits vello.loorits at emhi.ee
Thu Feb 10 06:44:08 EST 2011


Module gxwmap.c contains two times constants 0.785315, 0.00872572 and
0.0174514. If these numbers should be pi/4, pi/360 and pi/180, then pi
should be 3.141260, 3.141259 or 3.141252 respectively. As result central
meridian is not vertical you can see on pictures. Looks like someone
pushed keys "1" and "2" instead of "1" for pi.

Changing first ocurrence
  radius = tan (0.785315-(0.00872572*rlat));
  theta = (rlon+londif)*0.0174514;
to
  radius = tan((90 - rlat) * 0.008726646);
  theta = (rlon + londif) * 0.017453293;
and second ocurrence respectively gives vertical central meridian.

Maybe is better to define constant pi once, and use pi/4, pi/360 etc in
rest of code.



More information about the gradsusr mailing list