Curve geometry 3
Last updated
Last updated
Lets try to compute an approximation of the length travelled along curve, or more formally the curve’s arc-length, using techniques we have developed. First we will divide a curve into a number of points, then we will compute distances among consecutive points and finally sum up all partial distances. Note that for simplicity here we will use a “periodic” curve i.e. a closed loop, but the approach is general.
We use here some new components including “mass summation”, which just adds up all elements of a list; and the “shift list” component which cycles forward or backward a list’s elements by a number of positions. In this scenario, we use the component’s default behaviour which is to shift the first element of the input list to the end i.e. cycle backward by one position.
The reason for performing this shift is to create pairs of consecutive points such that we can supply them to the “point distance” component. The concept of reorganizing items of a sequence for the sake of performing an operation that expects data is a certain order/format is very common and we will see more of in future segments.
Practice
A simpler graph to arc-length approximation is to just produce a polyline between consecutive points and sum the linear segments’ lengths. Try to develop this approach. Hint: use the “explode” curve and the “end points” components.
You may also generate the list of partial distances using the “list item” component outputting pairs of consecutive points. Which of all those approaches explored seems computationally the most efficient?
Experiment with various geometric shapes and the number of points required for approximating the arc-length up to 5 decimal places. Use the curve “length” component as benchmark. Would an infinite number of points exactly equal the actual arc-length of a, as-in any, curve?
Next we explore some geometric properties of curves. A first property of interest is the tangent to a curve. A curve’s tangent is evaluated not unlike a point at parameter along the curve. Together, the point and tangent vector, describe a line that best fits the curve in a local sense. This is often expressed as a line that touches the curve at a particular point. Below we construct the tangent vector at a point of a curve from first principles for illustration purposes as the “evaluate curve” component already computes the tangent vector.
Here we compute a point at “t” i.e. p = curve(t)
and a point slightly ahead of the previous, say at “t + 0.001” i.e. q = curve( t + 0.001 )
. By subtracting the two points we produce a vector . We scale the vector produced by the difference of parameters used “0.001” thus we produce . Finally, we translate the original point “p” using the vector , to produce a new point which we draw a line connecting it to “p”.
From the animation we observe that when this forward distance is large, the line intersects the curve producing what is known as a “secant”. But as we the parameter spacing becomes smaller we begin approximating the curve’s tangent at that point. The construction thus presents a way of computing the first derivative of curve at a parameter which geometrically represents its tangent vector.
The first derivative is symbolically expressed as or .
The animation above demonstrates applying the same operation multiple times. Here instead of normalizing the series using numerous component nodes as seen earlier, we insert the expression 1.0 / ( x – 1 )
directly into the step parameter to cut down on verbosity.
Practice
Experiment with generating points along the tangents for a number of points along a curve. Draw curves from the generated points and interpolate new curves. Is the tangent image of a curve a translation?
The magnitude of the tangent vector captures the speed of a point moving along the curve. Plot the this speed value against the parameter “t” to visualize the speed profile. Btw. Newton came up with calculus exactly for tracking the motion of objects.
Create a graphical calculator model for plotting a curve, use the “expression” component, and also plot along its first derivative curve. Maybe this will be useful for your math course?
Look up in Wikipedia the topic of a curve’s arc-length []. Consider how the operations we performed are related to the definite integral of a curve’s first derivative vector magnitudes.
It is the limit of the expression as approaches zero. Here we just skipped the approaching part and used a small enough number. This is also known as numerical differentiation or specifically forward finite differences scheme [].