Point Sequence Interpolation

前端 未结 9 594
广开言路
广开言路 2021-01-02 07:36

Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them?

2D and 3D solutions are welcome. Solutions tha

9条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 07:58

    Unfortunately the Lagrange or other forms of polynomial interpolation will not work on an arbitrary set of points. They only work on a set where in one dimension e.g. x

    xi < xi+1

    For an arbitary set of points, e.g. an aeroplane flight path, where each point is a (longitude, latitude) pair, you will be better off simply modelling the aeroplane's journey with current longitude & latitude and velocity. By adjusting the rate at which the aeroplane can turn (its angular velocity) depending on how close it is to the next waypoint, you can achieve a smooth curve.

    The resulting curve would not be mathematically significant nor give you bezier control points. However the algorithm would be computationally simple regardless of the number of waypoints and could produce an interpolated list of points at arbitrary granularity. It would also not require you provide the complete set of points up front, you could simply add waypoints to the end of the set as required.

提交回复
热议问题