atan2: Two argument arc-tangent

Description Usage Arguments See Also Examples

Description

For SpatRasters x and y, atan2(y, x) returns the angle in radians for the tangent y/x, handling the case when x is zero. See Trig

See Math-methods for other trigonometric and mathematical functions that can be used with SpatRasters.

Usage

1
2
## S4 method for signature 'SpatRaster,SpatRaster'
atan2(y, x)

Arguments

y

SpatRaster

x

SpatRaster

See Also

Math-methods

Examples

1
2
3
4
5
r1 <- rast(nrows=10, ncols=10)
r2 <- rast(nrows=10, ncols=10)
values(r1) <- (runif(ncell(r1))-0.5) * 10
values(r2) <- (runif(ncell(r1))-0.5) * 10
atan2(r1, r2)

terra documentation built on Oct. 11, 2021, 9:09 a.m.