For a vector-valued curve f: [a, b] -> R^d, the arc length is
\(\int_a^b \lVert f'(t) \rVert\, dt\) – the length traced out by f in
R^d.
Arguments
- f
a
tf_mvobject.- ...
forwarded to
tf_integrate()whenmethod = "derive".- arg, lower, upper
optional evaluation/integration grid and limits.
- definite
TRUE(default) returns a numeric vector of total arc lengths per curve;FALSEreturns the cumulative arc length \(s(t) = \int_a^t \lVert f'(u) \rVert\, du\) as a univariatetfd.- method
"polyline"(default) or"derive".
Details
Two methods are supported:
"polyline"(default): sum of the Euclidean lengths of the line segments between consecutive sample points (inR^d). Each curve is evaluated on the union of its components' argument grids (or a suppliedarg) and the segment-sum is computed in closed form. For rawtfd_mvdata this is more accurate than"derive"because it avoids the compounding error of numerical differentiation followed by quadrature."derive": composes the existing verbs – per-component differentiation (tf_derive()), pointwise speedtf_speed(), thentf_integrate(). Best fortfb_mv(analytical derivatives) or when a customtf_integrate(...)argument is needed.
See also
Other tf_mv-class:
plot.tf_mv(),
tf_geom,
tf_mv_methods,
tfb_mfpc(),
tfb_mv(),
tfd_mv()
Examples
# unit circle parameterised on [0, 1] -- arc length is 2*pi
t <- seq(0, 1, length.out = 401)
circ <- tfd_mv(list(
x = tfd(matrix(cos(2 * pi * t), nrow = 1), arg = t),
y = tfd(matrix(sin(2 * pi * t), nrow = 1), arg = t)
))
tf_arclength(circ)
#> [1] 6.283121
tf_arclength(circ, lower = 0, upper = 0.25) # quarter -> pi/2
#> [1] 1.57078
tf_arclength(circ, definite = FALSE) # cumulative s(t)
#> tfd[1]: [0,1] -> [0,6.283121] based on 401 evaluations each
#> interpolation by tf_approx_linear
#> [1]: ▁▁▁▂▂▂▂▃▃▃▄▄▄▅▅▅▆▆▆▇▇▇▇███