# How to use Monotone cubic interpolation in 3D?

I wanted to use Monotone cubic interpolation, but the site only provide explanation for 2D case. How can I extend it to 3D?

• Do you mean that you have a set of 3D control points, C0, C1...Cn, and, I assume, some rotation matrix, P, such that, (P.Ci) [x] is strictly increasing, as are (P.Ci) [y] and (P.Ci) [z] ? – Simon F Apr 24 '17 at 11:56
• No, i mean in 3D a point is defined by (x, y, z) instead of (x, y). – Bla... Apr 24 '17 at 12:04
• Your question is ambiguous as you don't specify monotonic in relation to what in 3D? – JarkkoL Apr 25 '17 at 13:10
• @JarkkoL You need to check the link that I provided. – Bla... Apr 25 '17 at 15:27
• It doesn't disambiguate how you want the function to be monotonic in 3D. If you want the function to be monotonic along y-axis like in the 2D case, it's trivial extension, but if you want it to be monotonic along each axis, it's different. So which is it? Please clarify your question. – JarkkoL Apr 25 '17 at 15:58

## 1 Answer

Ok, monotonic interpolation depends on what you are monotonic about. For a simple 1D function interpolation monotonicity is easy to define. But for a 2D and 3D dataset its not so self evident what the situation would be.

• First you could interpolate along a independent variable t in which case your monotonicity is most probably in relation to t. This is the same as interpolating each direction separately.

• Second you could interpolate along one of the axes, so that your interpolant becomes a function of position on that axis. Reducing a 2D case into a 1D case and a 3D case to two separate 2D cases.

• Third you could interpolate on some other spatial variable.

So you see the question is a bit open ended and is hard to say for sure.

• In the link provided above it's Monotone cubic Hermite interpolation. The idea is to maintain the direction of tangent vectors. Any idea how to extend it for 3D case? – Bla... Jul 5 '17 at 6:40
• @Bla... So you dont actually want a monotone curve at all then? As you ar not defining what your going to be monotone about. Try a catmul-rom spline. – joojaa Jul 5 '17 at 6:52