ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 14 Nov 2011 21:44:56 +0100Evenly space points along a parametric curve?https://ask.sagemath.org/question/8474/evenly-space-points-along-a-parametric-curve/Are there arc-length parametrization functions hidden somewhere in Sage? I have some 3D parametric curves (smooth) of length `L` along which I would like to put `n` dots at regular intervals. What I've been doing so far is using numerical integration to find the arc length parameter, and then using `find_root` to find the positions of the dots (spaced by arc length `L/n`).
This is pretty slow, and has the further limitation that I need to specify a region on which `find_root` should work. If the parametrization is really uneven, it's tough to develop a good initial estimate for where to look.
So, does anyone have other ideas for doing this? Thanks!
UPDATE: Here are some examples -- they're different fibers in the Hopf fibration, and are given by `r = (rx,ry,rz)`
Example 1:
rx(t) = -0.309*cos(t)*arccos(0.951*cos(-t - 1.57))/(sqrt(-0.904*cos(-t - 1.570)^2 + 1)*pi)
ry(t) = -0.309*sin(t)*arccos(0.951*cos(-t - 1.57))/(sqrt(-0.904*cos(-t - 1.57)^2 + 1)*pi)
rz(t) = 0.951*sin(-t - 1.57)*arccos(0.951*cos(-t - 1.57))/(sqrt(-0.904*cos(-t - 1.57)^2 + 1)*pi)]
Example 2:
rx(t) = -0.707*cos(t)*arccos(0.707*cos(-t - 1.57))/(sqrt(-0.5*cos(-t - 1.57)^2 + 1)*pi)
ry(t) = -0.707*sin(t)*arccos(0.707*cos(-t - 1.57))/(sqrt(-0.5*cos(-t - 1.57)^2 + 1)*pi)
rz(t) = 0.707*sin(-t - 1.57)*arccos(0.707*cos(-t - 1.57))/(sqrt(-0.5*cos(-t - 1.57)^2 + 1)*pi)
nilesMon, 14 Nov 2011 21:44:56 +0100https://ask.sagemath.org/question/8474/