[GRASSLIST:4929] Re: 100KM raduis viewshed
Paul Kelly
paul-grass at stjohnspoint.co.uk
Mon Nov 11 04:29:10 EST 2002
On 11 Nov 2002, Dan Jacobson wrote:
> >>>>> "G" == Glynn Clements <glynn.clements at virgin.net> writes:
>
> G> Alternatively, you could compute the heading relative to the centre
> G> of the map (or any other point) using the (undocumented)
> G> two-argument form of r.mapcalc's atan() function, e.g.
>
> G> r.mapcalc "eval(heading = atan(x() - $xc, y() - $yc), ...
>
> G> Note: the argument order is the reverse of ANSI C's atan2() function.
>
> $ xc=235577 yc=2675353 ;\
> r.mapcalc "eval(heading = atan(x() - $xc, y() - $yc), \
> nantou.triang = heading>140 && heading<170)"
> you have confused me
>
> I even tried if(heading...)
What about
xc=235577 yc=2675353 ;\
r.mapcalc "nantou.triang = eval(heading = atan(x() - $xc, y() - $yc), \
heading>140 && heading<170)"
So the last expression in the eval is the one that is assigned to every
cell in the output map. This worked for me.
> --
> http://jidanni.org/ Taiwan(04)25854780
>
>
More information about the grass-user
mailing list