[GRASS5] Zoom

Glynn Clements glynn.clements at virgin.net
Wed Apr 24 12:55:29 EDT 2002


Radim Blazek wrote:

> while finishing d.zoom, I'am facing this problem:
> 
> WIND:
> proj:       99
> zone:       0
> north:      5119112.5
> south:      5119112.4
> east:       1711752.3
> west:       1711752.2
> cols:       1
> rows:       1
> e-w resol:  0.1
> n-s resol:  0.1
> 
> G_get_window(&window);
> fprintf(stderr, "%.15f\n", window.ns_res);
> 
> prints:
> 0.099999999627471
> 
> I expected 0.1. Can anyone help me, explain that?

Note that the resolution fields are ignored; they are generated by
G_adjust_Cell_head() by dividing (north - south) and (east - west) by
the number of rows and columns.

The subtractions will result in an increase in relative error. The
absolute error is determined by the precision of north, south, east
and west. The results of the subtractions will have the same absolute
error, but the magnitudes will be smaller by factors of 51e6 (n-s) and
17e6 (e-w), resulting in equivalent increases in absolute error.

Double-precision FP has ~15 decimal digits of precision, of which ~7
are being lost, leaving ~8 digits of precision; which corresponds to
the above.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list