# Spline derivation

This topic is 4486 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello! Source: http://www.bergen.org/AAST/projects/3DSMaxTutorial/mathematics.html That's the curve: and the formulas: . How do I get the x1', x2', y1', y2' derivations for the formulas? Thank you,

##### Share on other sites
Cubic splines use a weighted (blended) sum of 4 points: you supply them.

You can also evaluate a Bezier curve using repeated linear interpolation using DeCasteljau.

##### Share on other sites
Firstly, those formulas aren't entirely accurate. For example, when the interpolation variable t is 0, you'd expect to end up at one of the end points of the curve, while in fact you end up at the point (x1 + x2, y1 + y2)

As to your actual question, it seems a bit off... To get those derivatives, derive each function by the specific variable...
I think that what you're looking for is the derivative of the curve. ie. deriving with respect to t instead of x1

##### Share on other sites
If the OP needs the derivative (tangent) of the Bezier curve at t, it is P12 - P02 (the last DeCasteljua segment). More info here. The first and last control segments are tangents to the points P0 and P3, respectively (when evaluated, t=0, t=1).

See also section 2.5, parametric derivative which is a degree n-1 curve (n = 3: cubic => new curve is n = 2: quadratic, etc.). The first derivative curve is also called a hodograph.

##### Share on other sites
I would use the following curve equation:
P(t) = (1 - t)3P0 + 3t(1 - t)2P1 + 3t2(1 - t)P2 + t3P3

It uses actual control points, instead of two end points and their derivative vectors 3(P1 - P0) and 3(P3 - P2).

##### Share on other sites
Quote:
 Original post by ZipsterI would use the following curve equation:P(t) = (1 - t)3P0 + 3t(1 - t)2P1 + 3t2(1 - t)P2 + t3P3It uses actual control points, instead of two end points and their derivative vectors 3(P1 - P0) and 3(P3 - P2).

That's a good point. The OP's diagram's tangent/derivative vectors are a bit short (the end of the vectors appear to be the inner geometric control points)...

The matrix evaluation form:

flt Mat4::evalSpline(flt a,flt controlPoints[4]) {  Vec4 s = *this ^ *(Vec4 *)controlPoints; // ^ = Mat4 transform Vec4  return ((s.x*a + s.y)*a + s.z)*a + s.w;} // Mat4::evalSpline

allows evaluation of many different spline types (Bezier, b-spline, Hermite, Catmull-Rom, etc.).

1. 1
Rutin
19
2. 2
JoeJ
15
3. 3
4. 4
5. 5

• 24
• 20
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001778
×