0

If the curvature of a line in 3D space is defined as the derivative of the tangent to the curve which in turn is the derivative of the coordinates of the curve, is it possible to reverse the procedure and reconstruct 3D curve coordinates from curvature + initial tangent vector + initial point vector?

Something like:

import numpy as np

x0 = np.array([0,0,0])
T0 = np.array([1,0,0])
K = np.zeros((100,3))
K[:, 0] = np.pi

# Integrate curvature to get tangent
Kv = (K[1:] + K[:-1]) / 2
T = np.concatenate([T0[None, ...], Kv], axis=0).cumsum(axis=0)

# Integrate tangent to get position
Tv = (1 / (N - 1)) * T / np.linalg.norm(T, axis=-1, keepdims=True)
X = np.concatenate([X0[None, ...], Tv], axis=0).cumsum(axis=0)

I know there are plenty of mistakes in the above, but if anyone can give me any pointers on if/how this could be done I would be very grateful!

lopsided
  • 2,370
  • 6
  • 28
  • 40
  • well inverse of derivation is integration ... so why not integrate the curvature + fit the constraints with your edge conditions (initial position and tangent). However beware we do not know how to integrate arbitrary functions so either do it numerically which is easy or convert to polynomial form first ... so if `derivate(derivate(position)) = derivate(tangent) = curvature` then `position = integrate(tangent) = integrate(integrate(curvature))` just like we do with `position,speed` and `acceleration` in [Newton d'Alembert physics](https://stackoverflow.com/a/19764828/2521214) – Spektre Mar 14 '22 at 13:04
  • 2
    In general, you would also need the [*torsion*](https://en.wikipedia.org/wiki/Torsion_of_a_curve) of the curve. To reconstruct the curve, you integrate the [Frenet-Serret system](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas) system of differential equations. – Warren Weckesser Mar 14 '22 at 13:13
  • @WarrenWeckesser thx for the note +1 ... was still thinking too much 2D and did not realize this :) ... btw I think you should convert your comment into answer ... – Spektre Mar 15 '22 at 09:05

0 Answers0