vc_plot_related_rates: Display the gradient and a stored related-rates velocity

View source: R/related_rates.R

vc_plot_related_ratesR Documentation

Description

Display the gradient and a stored related-rates velocity

Usage

vc_plot_related_rates(
  result,
  g,
  xlim = NULL,
  ylim = NULL,
  n = 61L,
  vector_scale = 1,
  title = NULL
)

Arguments

result

Result of vc_related_rates() in two dimensions.

g

Same scalar constraint used for calculation.

xlim, ylim

Optional contour bounds covering the point and velocity tip.

n

Number of samples per contour coordinate, at least two.

vector_scale

Positive display multiplier for both vectors.

title

Optional character title.

Details

Reuses vc_plot_gradient without recalculating derivatives or rates. The velocity segment is a local first-order vector, not an integrated path.

Value

Plotly widget; unresolved velocities are omitted. Sampled contours show the scalar field, not a certified constraint curve or path.

Examples

if(requireNamespace("plotly",quietly=TRUE)) {
  g <- function(v)sum(v^2)-25
  r <- vc_related_rates(g,c(4,3),c(-1,NA),TRUE)
  vc_plot_related_rates(r,g,vector_scale=.2)
}

vectorialcalculus documentation built on Nov. 17, 2026, 1:09 a.m.