Learn R Programming

hydReng (version 0.1.0)

wetted_perimeter: Wetted Perimeter

Description

Calculates the wetted perimeter of a CSarbitrary or CScircle object for given water levels.

Usage

wetted_perimeter(object, h, ret = "P")

Value

A numeric vector or matrix of wetted perimeter based on the `ret` argument.

Arguments

object

An object of class CSarbitrary or CScircle.

h

A numeric vector of water levels (m). For CScircle, only a single numeric value is allowed.

ret

A character string. If `P`, returns total wetted perimeter. If `Pii`, returns wetted perimeter by segment.

Examples

Run this code
# Example for CSarbitrary object
x <- c(0, 4, 9, 13)
z <- c(2, 0, 0, 2)
cs <- CSarbitrary(x = x, z = z, xb_l = 4, xb_r = 9, kSt_B = 35,
                  kSt_l = 45, kSt_r = 45)

# Calculate total wetted perimeter at water levels 1 m and 2 m
h <- c(1, 2)
wetted_perimeter(cs, h, ret = "P")

# Calculate wetted perimeter for each segment at the same water levels
wetted_perimeter(cs, h, ret = "Pii")

# Example for CScircle object
csC <- CScircle(Di = 1, kSt = 75)

# Calculate total wetted perimeter at water level 1 m
h <- 1
wetted_perimeter(csC, h)

Run the code above in your browser using DataLab