# [GRASSLIST:4926] Re: 100KM raduis viewshed

Dan Jacobson jidanni at dman.ddts.net
Mon Nov 11 03:39:25 EST 2002

```>>>>> "G" == Glynn Clements <glynn.clements at virgin.net> writes:

>> I want to concentrate on just 30 degrees of my horizon.  That means
>> I must use mapcalc to make a patt_map mask that any cell with the
>> azimuths I want to be =1. A pie slice shaped mask. Hmmm. How to
>> proceed?

G> Probably the simplest method would be to create a vector map
G> consisting of a single polygon, then convert it to a raster map with
G> v.to.rast.

I wouldn't know where to begin there.  Alternatively?

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), \