Learn R Programming

vectorialcalculus (version 1.0.5)

region_xyz0: Planar region \(\{(x, y): a \leq x \leq b, H1(x) \leq y \leq H2(x)\}\) drawn at height z0

Description

Builds the planar region $$\Omega = \{(x,y):\ a \le x \le b,\ H_1(x) \le y \le H_2(x)\}$$ and renders it as a thin patch on the plane \(z = z_0\). Optionally it draws the boundary curves, partition lines along \(x\), and a surface patch.

Builds the planar region defined by \(a \le x \le b\) and \(H_1(x) \le y \le H_2(x)\), and renders it as a thin patch on the plane \(z = z_0\). Optionally it draws the boundary curves, partition lines along \(x\), and a surface patch.

Usage

region_xyz0(
  H1,
  H2,
  a,
  b,
  z0,
  D,
  plot = TRUE,
  n_curve = 800,
  show_surface = FALSE,
  surface_colorscale = "Blues",
  surface_opacity = 0.3,
  show_surface_grid = TRUE,
  surface_grid_color = "rgba(60,80,200,0.25)",
  surface_grid_width = 1,
  boundary_line = list(color = "blue", width = 2),
  partition_line = list(color = "blue", width = 1),
  show_end_edges = TRUE,
  scene = list(aspectmode = "data", xaxis = list(title = "x"), yaxis = list(title = "y"),
    zaxis = list(title = "z")),
  bg = list(paper = "white", plot = "white")
)

region_xyz0( H1, H2, a, b, z0, D, plot = TRUE, n_curve = 800, show_surface = FALSE, surface_colorscale = "Blues", surface_opacity = 0.3, show_surface_grid = TRUE, surface_grid_color = "rgba(60,80,200,0.25)", surface_grid_width = 1, boundary_line = list(color = "blue", width = 2), partition_line = list(color = "blue", width = 1), show_end_edges = TRUE, scene = list(aspectmode = "data", xaxis = list(title = "x"), yaxis = list(title = "y"), zaxis = list(title = "z")), bg = list(paper = "white", plot = "white") )

Value

A list with components:

data

List (or tibble, depending on the implementation) with the sampled curves and/or the grid used.

plot

A plotly object when plot = TRUE, otherwise NULL.

A list with components:

data

List (or tibble, depending on the implementation) with the sampled curves and/or the grid used.

plot

A plotly object when plot = TRUE, otherwise NULL.

Arguments

H1, H2

Functions H_i(x); lower and upper y-boundaries.

a, b

Numeric scalars; x-interval endpoints with \(a < b\).

z0

Numeric scalar; height of the display plane \(z = z_0\).

D

Integer > 0; number of x-partitions (controls vertical slices and grid density).

plot

Logical; if TRUE, draw the region with plotly.

n_curve

Integer; number of samples used to trace each boundary curve \(y = H_i(x)\).

show_surface

Logical; if TRUE, draw a thin surface patch of the region at \(z = z_0\).

surface_colorscale

Character; Plotly colorscale for the surface patch (for example, "Blues").

surface_opacity

Numeric in \([0,1]\); opacity of the surface patch.

show_surface_grid

Logical; show grid/contours on the surface patch.

surface_grid_color

Character; color for surface grid lines.

surface_grid_width

Numeric; width for surface grid lines.

boundary_line

List; style for the boundary polylines (for example, list(color = "blue", width = 2)).

partition_line

List; style for the partition lines at \(x = a + k (b - a) / D\).

show_end_edges

Logical; draw edges at \(x = a\) and \(x = b\).

scene

List; Plotly 3D scene options.

bg

List with paper and plot background colors.

Examples

Run this code
H1 <- function(x) 0
H2 <- function(x) 1 - x
# Region under H2 and above H1 in [0,1], drawn at z = 0
# region_xyz0(H1, H2, a = 0, b = 1, z0 = 0,
#             D = 20, plot = TRUE, show_surface = TRUE)

H1 <- function(x) 0
H2 <- function(x) 1 - x
# Region under H2 and above H1 in [0,1], drawn at z = 0
# region_xyz0(H1, H2, a = 0, b = 1, z0 = 0,
#             D = 20, plot = TRUE, show_surface = TRUE)

Run the code above in your browser using DataLab