I have a 3D parametric curve defined as P(t) = [x(t), y(t), z(t)].
I'm looking for a function to reparametrize this curve in terms of arc-length. I'm using OpenSCAD, which is a declarative language with no variables (constants only), so the solution needs to work recursively (and with no variables aside from global constants and function arguments).
More precisely, I need to write a function Q(s) that gives the point on P that is (approximately) distance s along the arc from the point where t=0. I already have functions for numeric integration and derivation that can be incorporated into the answer.
Any suggestions would be greatly appreciated!
p.s It's not possible to pass functions as a parameter in OpenSCAD, I usually get around this by just using global declarations.
If a curve is defined by parametric equations x = g(t), y = (t) for c t d, the arc length of the curve is the integral of (dx/dt)2 + (dy/dt)2 = [g/(t)]2 + [/(t)]2 from c to d.
Arc Length=∫dc√1+[g′(y)]2dy. Let g(y)=3y3. Calculate the arc length of the graph of g(y) over the interval [1,2].
We can view this parameter as distance; that is, the arc length of the graph from to is 3, the arc length from to is 4, etc. If one wants to find the point 2.5 units from an initial location (i.e., ), one would compute . This parameter is very useful, and is called the arc length parameter.
Arc length is the distance between two points along a section of a curve.
1 Reparametrization With Respect to Arc Length We begin with our familiar formula for arc length. Given a vector function ~r0(t), we can calculate the length from t= ato t= bas L= Z b a j~r0(t)jdt We can actually turn this formula into a function of time.
The arc length of a curve is the length of a curve between two points. You can think of a measuring tape taking the shape of the curve. How to find the arc length of a polar curve?
And the most useful application of the arc length parameterization is that a vector function r → ( t) gives the position of a point in terms of the parameter t. Assuming s is the distance along the curve from a fixed starting point, and if we use s for the variable, then r → ( s) is the position in space in terms of the distance along the curve.
Find the arc length of f ( x) = 1 2 x 2 on the interval [ 1, 2]. Evaluate the resulting definite integral using a Computer Algebra System or a graphing calculator. Begin by using The Power Rule to find the derivative of the function Arc Length = ∫ a b 1 + ( f ′ ( x)) 2 d x. which can be done with Trigonometric Substitution.
The length of an arc sigma
between parameter values t=0
and t=T
can be computed by solving the following integral:
sigma(T) = Integral[ sqrt[ x'(t)^2 + y'(t)^2 + z'(t)^2 ],{t,0,T}]
If you want to parametrize your curve with the arc-length, you have to invert this formula. This is unfortunately rather difficult from a mathematics point of view. The simplest method is to implement a simple bisection method as a numeric solver. The computation method quickly becomes heavy so reusing previous results is ideal. The secant method is also useful as the derivative of sigma(t)
is already known and equals
sigma'(t) = sqrt[ x'(t)^2 + y'(t)^2 + z'(t)^2]
Maybe not really the most helpful answer, but I hope it gives you some ideas. I cannot help you with the OpenSCad implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With