Learn R Programming

hydReng (version 0.1.0)

wetted_area: Wetted Area

Description

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

Usage

wetted_area(object, h, ret = "A")

Value

A numeric vector or matrix of wetted areas 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 `A`, returns total wetted area. If `Aii`, returns wetted area 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 area at water levels 1 m and 2 m
h <- c(1, 2)
wetted_area(cs, h, ret = "A")

# Calculate wetted area for each segment at the same water levels
wetted_area(cs, h, ret = "Aii")

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

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

Run the code above in your browser using DataLab