slopecalc: Determines the Slopes Along the Bearing Area Curve

View source: R/bestfit.R

slopecalcR Documentation

Determines the Slopes Along the Bearing Area Curve

Description

Calculates the slopes along the bearing area curve of a raster or matrix. Slopes are determined at points x, from point x - h to x + h.

Usage

slopecalc(x, h, f)

Arguments

x

A vector of x values.

h

Spacing before and after each point. 2h is the distance over which slopes are calculated.

f

Bearing area function as calculated with bearing_area.

Value

A dataframe with the slope for each segment with centerpoint x.

Examples

# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)

# find the slopes along the bearing area curve
ba <- bearing_area(normforest)
x <- seq(0, 1, length.out = 100000)
slopes <- slopecalc(x = x, h = 0.01, f = ba)

geodiv documentation built on Oct. 6, 2023, 1:07 a.m.