Learn R Programming

raster (version 1.8-3)

atan2: Two argument arctangent function

Description

For RasterLayer arguments x and y, atan2(y, x) returns the angle in radians for the tangent y/x, handling the case when x is zero. See link[base]{Trig} See Math-methods for other trigonometric and mathematical functions that can be used with a Raster* objects.

Usage

atan2(y, x)

Arguments

y
A RasterLayer object
x
A RasterLayer object

See Also

Math-methods

Examples

Run this code
r1 <- r2 <- raster(nrow=10, ncol=10)
r1[] <- (runif(ncell(r1))-0.5) * 10
r2[] <- (runif(ncell(r1))-0.5) * 10
atan2(r1, r2)

Run the code above in your browser using DataLab