| vc_secant | R Documentation |
Compute the finite slope (f(x1)-f(x0))/(x1-x0). This is a secant slope, not a derivative or evidence of differentiability.
vc_secant(f, x0, x1)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
x0 |
Finite real scalar giving the first abscissa. |
x1 |
Finite real scalar giving a distinct second abscissa. |
Both function values, the displacement, the ordinate difference, and the quotient must be finite. Reversing the endpoints preserves the slope. No smoothness assumption is needed. Floating-point cancellation can affect the result; this operation does not estimate numerical error.
Plain list with type ("secant"), x0, y0, x1, y1, dx, dy, slope, and note. The line is y0 + slope * (x - x0). No intercept is computed, avoiding unnecessary cancellation in an intercept representation.
vc_secant(function(x) x^2, 1, 2)
sin |> vc_secant(x0 = 0, x1 = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.