ascii
@@ -24,12 +24,12 @@ So we turn to numerical approaches again. The method we'll look at here is the [
|
||||
\int_{-1}^{1}f(t) dt
|
||||
\simeq
|
||||
\left [
|
||||
\underset{strip\ 1}{ \underbrace{ C_1 \cdot f\left(t_1\right) }}
|
||||
\ +\ ...
|
||||
\ +\ \underset{strip\ n}{ \underbrace{ C_n \cdot f\left(t_n\right) }}
|
||||
\underset{strip~1}{ \underbrace{ C_1 \cdot f\left(t_1\right) }}
|
||||
~+~...
|
||||
~+~\underset{strip~n}{ \underbrace{ C_n \cdot f\left(t_n\right) }}
|
||||
\right ]
|
||||
=
|
||||
\underset{strips\ 1\ through\ n}{
|
||||
\underset{strips~1~through~n}{
|
||||
\underbrace{
|
||||
\sum_{i=1}^{n}{
|
||||
C_i \cdot f\left(t_i\right)
|
||||
|
@@ -76,7 +76,7 @@ That looks complicated, but it's not. Computing alpha is just a fraction involvi
|
||||
Of course, the recursion does need a stop condition:
|
||||
|
||||
\[
|
||||
d^k_0(t) = 0, \ d^0_i(t) = N_{i,1}(t) =
|
||||
d^k_0(t) = 0, ~d^0_i(t) = N_{i,1}(t) =
|
||||
\left\{\begin{matrix}
|
||||
1& \text{if } t \in [knot_i,knot_{i+1}) \\
|
||||
0& \text{otherwise}
|
||||
@@ -90,39 +90,39 @@ Thanks to Cox and de Boor, we can compute points on a B-Spline pretty easily usi
|
||||
\[
|
||||
d^3_3 = \left \{
|
||||
\begin{aligned}
|
||||
\alpha^3_3 \times d^2_3, & \ \textit{ with } d^2_3 = \left \{
|
||||
\alpha^3_3 \times d^2_3, & ~\textit{ with } d^2_3 = \left \{
|
||||
\begin{aligned}
|
||||
\alpha^2_3 \times d^1_3, & \ \textit{ with } d^1_3 =
|
||||
\alpha^2_3 \times d^1_3, & ~\textit{ with } d^1_3 =
|
||||
\left \{
|
||||
\begin{aligned}
|
||||
\alpha^1_3 \times d^0_3, & \ \textit{ with } d^0_3 \textit{ either 0 or 1} \\
|
||||
\alpha^1_3 \times d^0_3, & ~\textit{ with } d^0_3 \textit{ either 0 or 1} \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^1_3 \right ) \times d^0_2, & \ \textit{ with } d^0_2 \textit{ either 0 or 1} \\
|
||||
\left ( 1 - \alpha^1_3 \right ) \times d^0_2, & ~\textit{ with } d^0_2 \textit{ either 0 or 1} \\
|
||||
\end{aligned}
|
||||
\right . \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^2_3 \right ) \times d^1_2, & \ \textit{ with } d^1_2 =
|
||||
\left ( 1 - \alpha^2_3 \right ) \times d^1_2, & ~\textit{ with } d^1_2 =
|
||||
\left \{
|
||||
\begin{aligned}
|
||||
\alpha^1_2 \times d^0_2 & \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^1_2 \right ) \times d^0_1, & \ \textit{ with } d^0_1 \textit{ either 0 or 1} \\
|
||||
\left ( 1 - \alpha^1_2 \right ) \times d^0_1, & ~\textit{ with } d^0_1 \textit{ either 0 or 1} \\
|
||||
\end{aligned}
|
||||
\right . \\
|
||||
\end{aligned}
|
||||
\right . \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^3_3 \right ) \times d^2_2, & \ \textit{ with } d^2_2 = \left \{
|
||||
\left ( 1 - \alpha^3_3 \right ) \times d^2_2, & ~\textit{ with } d^2_2 = \left \{
|
||||
\begin{aligned}
|
||||
\alpha^2_2 \times d^1_2 & \\
|
||||
& \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^2_2 \right ) \times d^1_1, & \ \textit{ with } d^1_1 =
|
||||
\left ( 1 - \alpha^2_2 \right ) \times d^1_1, & ~\textit{ with } d^1_1 =
|
||||
\left \{
|
||||
\begin{aligned}
|
||||
\alpha^1_1 \times d^0_1 \\
|
||||
+ & \\
|
||||
\left ( 1 - \alpha^1_1 \right ) \times d^0_0, & \ \textit{ with } d^0_0 \textit{ either 0 or 1} \\
|
||||
\left ( 1 - \alpha^1_1 \right ) \times d^0_0, & ~\textit{ with } d^0_0 \textit{ either 0 or 1} \\
|
||||
\end{aligned}
|
||||
\right . \\
|
||||
\end{aligned}
|
||||
|
@@ -19,13 +19,13 @@ As you can see, things go horribly wrong quite quickly; even trying to approxima
|
||||
We start out with our start and end point, and for convenience we will place them on a unit circle (a circle around 0,0 with radius 1), at some angle *φ*:
|
||||
|
||||
\[
|
||||
S = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \ , \ \ E = \begin{pmatrix} cos(φ) \\ sin(φ) \end{pmatrix}
|
||||
S = \begin{pmatrix} 1 \\ 0 \end{pmatrix} ~, ~\ E = \begin{pmatrix} cos(φ) \\ sin(φ) \end{pmatrix}
|
||||
\]
|
||||
|
||||
What we want to find is the intersection of the tangents, so we want a point C such that:
|
||||
|
||||
\[
|
||||
C = S + a \cdot \begin{pmatrix} 0 \\ 1 \end{pmatrix} \ , \ \ C = E + b \cdot \begin{pmatrix} -sin(φ) \\ cos(φ) \end{pmatrix}
|
||||
C = S + a \cdot \begin{pmatrix} 0 \\ 1 \end{pmatrix} ~, ~\ C = E + b \cdot \begin{pmatrix} -sin(φ) \\ cos(φ) \end{pmatrix}
|
||||
\]
|
||||
|
||||
i.e. we want a point that lies on the vertical line through S (at some distance *a* from S) and also lies on the tangent line through E (at some distance *b* from E). Solving this gives us:
|
||||
@@ -41,8 +41,8 @@ First we solve for *b*:
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
1 = cos(φ) + b \cdot -sin(φ) \ → \
|
||||
1 - cos(φ) = -b \cdot sin(φ) \ → \
|
||||
1 = cos(φ) + b \cdot -sin(φ) ~→ \
|
||||
1 - cos(φ) = -b \cdot sin(φ) ~→ \
|
||||
-1 + cos(φ) = b \cdot sin(φ)
|
||||
\end{array}
|
||||
\]
|
||||
@@ -68,7 +68,7 @@ which we can then substitute in the expression for *a*:
|
||||
A quick check shows that plugging these values for *a* and *b* into the expressions for C<sub>x</sub> and C<sub>y</sub> give the same x/y coordinates for both "*a* away from A" and "*b* away from B", so let's continue: now that we know the coordinate values for C, we know where our on-curve point T for *t=0.5* (or angle φ/2) is, because we can just evaluate the Bézier polynomial, and we know where the circle arc's actual point P is for angle φ/2:
|
||||
|
||||
\[
|
||||
P_x = cos(\frac{φ}{2}) \ , \ \ P_y = sin(\frac{φ}{2})
|
||||
P_x = cos(\frac{φ}{2}) ~, ~\ P_y = sin(\frac{φ}{2})
|
||||
\]
|
||||
|
||||
We compute T, observing that if *t=0.5*, the polynomial values (1-t)², 2(1-t)t, and t² are 0.25, 0.5, and 0.25 respectively:
|
||||
@@ -93,10 +93,10 @@ And the distance between these two is the standard Euclidean distance:
|
||||
|
||||
\[
|
||||
\begin{aligned}
|
||||
d_x(φ) &= T_x - P_x = \frac{1}{4}(3 + cos(φ)) - cos(\frac{φ}{2}) = 2sin^4\left(\frac{φ}{4}\right) \ , \\
|
||||
d_y(φ) &= T_y - P_y = \frac{1}{4}\left(2tan\left(\frac{φ}{2}\right) + sin(φ)\right) - sin(\frac{φ}{2}) \ , \\
|
||||
d_x(φ) &= T_x - P_x = \frac{1}{4}(3 + cos(φ)) - cos(\frac{φ}{2}) = 2sin^4\left(\frac{φ}{4}\right) ~, \\
|
||||
d_y(φ) &= T_y - P_y = \frac{1}{4}\left(2tan\left(\frac{φ}{2}\right) + sin(φ)\right) - sin(\frac{φ}{2}) ~, \\
|
||||
&⇓\\
|
||||
d(φ) &= \sqrt{d^2_x + d^2_y} = \ ... \ = 2sin^4(\frac{φ}{4})\sqrt{\frac{1}{cos^2(\frac{φ}{2})}}
|
||||
d(φ) &= \sqrt{d^2_x + d^2_y} = ~... ~ = 2sin^4(\frac{φ}{4})\sqrt{\frac{1}{cos^2(\frac{φ}{2})}}
|
||||
\end{aligned}
|
||||
\]
|
||||
|
||||
|
@@ -39,7 +39,7 @@ In fact, the precision of a cubic curve at a quarter circle is considered "good
|
||||
|
||||
So with the error analysis out of the way, how do we actually compute the coordinates needed to get that "true fit" cubic curve? The first observation is that we already know the start and end points, because they're the same as for the quadratic attempt:
|
||||
|
||||
\[ S = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \ , \ \ E = \begin{pmatrix} cos(φ) \\ sin(φ) \end{pmatrix} \]
|
||||
\[ S = \begin{pmatrix} 1 \\ 0 \end{pmatrix} ~, ~\ E = \begin{pmatrix} cos(φ) \\ sin(φ) \end{pmatrix} \]
|
||||
|
||||
But we now need to find two control points, rather than one. If we want the derivatives at the start and end point to match the circle, then the first control point can only lie somewhere on the vertical line through S, and the second control point can only lie somewhere on the line tangent to point E, which means:
|
||||
|
||||
@@ -74,17 +74,17 @@ The distance from our guessed point to the start point is exactly the same as th
|
||||
So that just leaves us to find the distance from <i>t=0.5</i> to the baseline for an arbitrary angle φ, which is the distance from the centre of the circle to our <i>t=0.5</i> point, minus the distance from the centre to the line that runs from start point to end point. The first is the same as the point P we found for the quadratic curve:
|
||||
|
||||
\[
|
||||
P_x = cos(\frac{φ}{2}) \ , \ \ P_y = sin(\frac{φ}{2})
|
||||
P_x = cos(\frac{φ}{2}) ~, ~\ P_y = sin(\frac{φ}{2})
|
||||
\]
|
||||
|
||||
And the distance from the origin to the line start/end is another application of angles, since the triangle {origin,start,C} has known angles, and two known sides. We can find the length of the line {origin,C}, which lets us trivially compute the coordinate for C:
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
l = cos(\frac{φ}{2}) \ , \\
|
||||
l = cos(\frac{φ}{2}) ~, \\
|
||||
\left\{\begin{array}{l}
|
||||
C_x = l \cdot cos\left(\frac{φ}{2}\right) = cos^2\left(\frac{φ}{2}\right)\ , \\
|
||||
C_y = l \cdot sin\left(\frac{φ}{2}\right) = cos(\frac{φ}{2}) \cdot sin\left(\frac{φ}{2}\right)\ , \\
|
||||
C_x = l \cdot cos\left(\frac{φ}{2}\right) = cos^2\left(\frac{φ}{2}\right)~, \\
|
||||
C_y = l \cdot sin\left(\frac{φ}{2}\right) = cos(\frac{φ}{2}) \cdot sin\left(\frac{φ}{2}\right)~, \\
|
||||
\end{array}\right.
|
||||
\end{array}
|
||||
\]
|
||||
@@ -121,9 +121,9 @@ And after this tedious detour to find the coordinate for C<sub>1</sub>, we can f
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
E'_x = -sin(φ) \ ,\\
|
||||
E'_y = cos(φ) \ , \\
|
||||
||E'|| = \sqrt{ (-sin(φ))^2 + cos^2(φ)} = 1 \ , \\
|
||||
E'_x = -sin(φ) ~,\\
|
||||
E'_y = cos(φ) ~, \\
|
||||
||E'|| = \sqrt{ (-sin(φ))^2 + cos^2(φ)} = 1 ~, \\
|
||||
\\
|
||||
\left\{\begin{array}{l}
|
||||
C_2x = E_x - C_{1y} \cdot \frac{E_x'}{||E'||}
|
||||
@@ -146,7 +146,7 @@ So, to recap, given an angle φ, the new control coordinates are:
|
||||
C_1 = \left [ \begin{matrix}
|
||||
1 \\
|
||||
f
|
||||
\end{matrix} \right ],\ with\ f = \frac{4}{3} tan \left( \frac{φ}{4} \right)
|
||||
\end{matrix} \right ],~with~f = \frac{4}{3} tan \left( \frac{φ}{4} \right)
|
||||
\]
|
||||
|
||||
and
|
||||
@@ -155,16 +155,16 @@ and
|
||||
C_2 = \left [ \begin{matrix}
|
||||
cos(φ) + f \cdot sin(φ) \\
|
||||
sin(φ) - f \cdot cos(φ)
|
||||
\end{matrix} \right ],\ with\ f = \frac{4}{3} tan \left( \frac{φ}{4} \right)
|
||||
\end{matrix} \right ],~with~f = \frac{4}{3} tan \left( \frac{φ}{4} \right)
|
||||
\]
|
||||
|
||||
And, because the "quarter curve" special case comes up so incredibly often, let's look at what these new control points mean for the curve coordinates of a quarter curve, by simply filling in φ = π/2:
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
S = (1, 0) \ , \
|
||||
C_1 = \left ( 1, 4 \frac{\sqrt{2}-1}{3} \right ) \ , \
|
||||
C_2 = \left ( 4 \frac{\sqrt{2}-1}{3} , 1 \right ) \ , \
|
||||
S = (1, 0) ~, \
|
||||
C_1 = \left ( 1, 4 \frac{\sqrt{2}-1}{3} \right ) ~, \
|
||||
C_2 = \left ( 4 \frac{\sqrt{2}-1}{3} , 1 \right ) ~, \
|
||||
E = (0, 1)
|
||||
\end{array}
|
||||
\]
|
||||
@@ -173,9 +173,9 @@ Which, in decimal values, rounded to six significant digits, is:
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
S = (1, 0) \ , \
|
||||
C_1 = (1, 0.55228) \ , \
|
||||
C_2 = (0.55228 , 1) \ , \
|
||||
S = (1, 0) ~, \
|
||||
C_1 = (1, 0.55228) ~, \
|
||||
C_2 = (0.55228 , 1) ~, \
|
||||
E = (0, 1)
|
||||
\end{array}
|
||||
\]
|
||||
|
@@ -22,9 +22,9 @@ If we want to change the curve, we need to change the weights of each point, eff
|
||||
|
||||
\[
|
||||
Bézier(n,t) = \sum_{i=0}^{n}
|
||||
\underset{binomial\ term}{\underbrace{\binom{n}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{n}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\cdot\
|
||||
\underset{weight}{\underbrace{w_i}}
|
||||
\]
|
||||
|
@@ -22,9 +22,9 @@
|
||||
|
||||
\[
|
||||
Bézier(n,t) = \sum_{i=0}^{n}
|
||||
\underset{binomial\ term}{\underbrace{\binom{n}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{n}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\cdot\
|
||||
\underset{weight}{\underbrace{w_i}}
|
||||
\]
|
||||
|
@@ -66,7 +66,7 @@ And that's the first part done: the two components inside the parentheses are ac
|
||||
... = n \left (
|
||||
\frac{x!}{y!(x-y)!} t^{y} (1-t)^{x-y} - \frac{x!}{k!(x-k)!} t^k (1-t)^{x-k}
|
||||
\right )
|
||||
\ ,\ with\ x=n-1,\ y=k-1
|
||||
~,~with~x=n-1,~y=k-1
|
||||
\\
|
||||
... = n \left ( B_{(n-1),(k-1)}(t) - B_{(n-1),k}(t) \right )
|
||||
\end{array}
|
||||
@@ -98,7 +98,7 @@ Two of these terms fall way: the first term falls away because there is no -1<su
|
||||
|
||||
\[\begin{array}{lclc}
|
||||
n \cdot B_{n-1,BLUE[0]}(t) \cdot w_1 &-& n \cdot B_{n-1,BLUE[0]}(t) \cdot w_0 &+ \\
|
||||
n \cdot B_{n-1,RED[1]}(t) \cdot w_2 &-& \ n \cdot B_{n-1,RED[1]}(t) \cdot w_1 &+ \\
|
||||
n \cdot B_{n-1,RED[1]}(t) \cdot w_2 &-& ~n \cdot B_{n-1,RED[1]}(t) \cdot w_1 &+ \\
|
||||
n \cdot B_{n-1,MAGENTA[2]}(t) \cdot w_3 &-& n \cdot B_{n-1,MAGENTA[2]}(t) \cdot w_2 &+ \\
|
||||
...
|
||||
\end{array}\]
|
||||
@@ -109,14 +109,14 @@ And that's just a summation of lower order curves:
|
||||
Bézier_{n,k}(t) \frac{d}{dt} = n \cdot B_{(n-1),BLUE[0]}(t) \cdot (w_1 - w_0)
|
||||
+ n \cdot B_{(n-1),RED[1]}(t) \cdot (w_2 - w_1)
|
||||
+ n \cdot B_{(n-1),MAGENTA[2]}(t) \cdot (w_3 - w_2)
|
||||
\ + \ ...
|
||||
~+ ~...
|
||||
\]
|
||||
|
||||
We can rewrite this as a normal summation, and we're done:
|
||||
|
||||
\[
|
||||
Bézier_{n,k}(t) \frac{d}{dt} = \sum_{k=0}^{n-1} n \cdot B_{n-1,k}(t) \cdot (w_{k+1} - w_k)
|
||||
= \sum_{k=0}^{n-1} B_{n-1,k}(t) \cdot \underset{derivative\ weights}
|
||||
= \sum_{k=0}^{n-1} B_{n-1,k}(t) \cdot \underset{derivative~weights}
|
||||
{\underbrace{n \cdot (w_{k+1} - w_k)}}
|
||||
\]
|
||||
|
||||
@@ -126,21 +126,21 @@ Let's rewrite that in a form similar to our original formula, so we can see the
|
||||
|
||||
\[
|
||||
Bézier(n,t) = \sum_{i=0}^{n}
|
||||
\underset{binomial\ term}{\underbrace{\binom{n}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{n}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\cdot\
|
||||
\underset{weight}{\underbrace{w_i}}
|
||||
\]
|
||||
|
||||
\[
|
||||
Bézier'(n,t) = \sum_{i=0}^{k}
|
||||
\underset{binomial\ term}{\underbrace{\binom{k}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{k}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{k-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{k-i} \cdot t^{i}}}
|
||||
\cdot\
|
||||
\underset{derivative\ weight}{\underbrace{n \cdot (w_{i+1} - w_i)}}
|
||||
{\ , \ with \ k=n-1}
|
||||
\underset{derivative~weight}{\underbrace{n \cdot (w_{i+1} - w_i)}}
|
||||
{~, ~with ~k=n-1}
|
||||
\]
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ What are the differences? In terms of the actual Bézier curve, virtually nothin
|
||||
|
||||
\[ \begin{array}{llll}
|
||||
B(n,t), & & w = \{A,B,C,D\} \\
|
||||
B'(n,t), & n = 3, & w' = \{A',B',C'\} &= \{3 \cdot (B-A), {\ } 3 \cdot (C-B), {\ } 3 \cdot (D-C)\} \\
|
||||
B''(n,t), & n = 2, & w'' = \{A'',B''\} &= \{2 \cdot (B'-A'), {\ } 2 \cdot (C'-B')\} \\
|
||||
B'(n,t), & n = 3, & w' = \{A',B',C'\} &= \{3 \cdot (B-A), {~} 3 \cdot (C-B), {~} 3 \cdot (D-C)\} \\
|
||||
B''(n,t), & n = 2, & w'' = \{A'',B''\} &= \{2 \cdot (B'-A'), {~} 2 \cdot (C'-B')\} \\
|
||||
B'''(n,t), & n = 1, & w''' = \{A'''\} &= \{1 \cdot (B''-A'')\}
|
||||
\end{array} \]
|
||||
|
||||
|
@@ -92,9 +92,9 @@ It's basically just a sum of "every combination of <i>a</i> and <i>b</i>", progr
|
||||
|
||||
\[
|
||||
Bézier(n,t) = \sum_{i=0}^{n}
|
||||
\underset{binomial\ term}{\underbrace{\binom{n}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{n}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\]
|
||||
|
||||
And that's the full description for Bézier curves. Σ in this function indicates that this is a series of additions (using the variable listed below the Σ, starting at ...=<value> and ending at the value listed on top of the Σ).
|
||||
|
@@ -90,9 +90,9 @@
|
||||
|
||||
\[
|
||||
Bézier(n,t) = \sum_{i=0}^{n}
|
||||
\underset{binomial\ term}{\underbrace{\binom{n}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{n}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{n-i} \cdot t^{i}}}
|
||||
\]
|
||||
|
||||
这就是贝塞尔曲线完整的描述。在这个函数中的Σ表示了这是一系列的加法(用Σ下面的变量,从...=<值>开始,直到Σ上面的数字结束)。
|
||||
|
@@ -33,7 +33,7 @@ Although with the [caveat](https://en.wikipedia.org/wiki/Caveat_emptor#Caveat_le
|
||||
The derivative of a cubic Bézier curve is a quadratic Bézier curve, and finding the roots for a quadratic polynomial means we can apply the [Quadratic formula](https://en.wikipedia.org/wiki/Quadratic_formula). If you've seen it before, you'll remember it, and if you haven't, it looks like this:
|
||||
|
||||
\[
|
||||
Given\ f(t) = at^2 + bt + c,\ f(t)=0\ when\ t = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
|
||||
Given~f(t) = at^2 + bt + c,~f(t)=0~when~t = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
|
||||
\]
|
||||
|
||||
So, if we can rewrite the Bézier component function as a plain polynomial, we're done: we just plug in the values into the quadratic formula, check if that square root is negative or not (if it is, there are no roots) and then just compute the two values that come out (because of that plus/minus sign we get two). Any value between 0 and 1 is a root that matters for Bézier curves, anything below or above that is irrelevant (because Bézier curves are only defined over the interval [0,1]). So, how do we convert?
|
||||
@@ -42,8 +42,8 @@ First we turn our cubic Bézier function into a quadratic one, by following the
|
||||
|
||||
\[
|
||||
\begin{array}{l}
|
||||
B(t)\ uses\ \{ p_1,p_2,p_3,p_4 \} \\
|
||||
B'(t)\ uses\ \{ v_1,v_2,v_3 \},\ where\ v_1 = 3(p_2-p_1),\ v_2 = 3(p_3-p_2),\ v_3 = 3(p_4-p_3)
|
||||
B(t)~uses~\{ p_1,p_2,p_3,p_4 \} \\
|
||||
B'(t)~uses~\{ v_1,v_2,v_3 \},~where~v_1 = 3(p_2-p_1),~v_2 = 3(p_3-p_2),~v_3 = 3(p_4-p_3)
|
||||
\end{array}
|
||||
\]
|
||||
|
||||
|
@@ -29,8 +29,8 @@ Of course, before we do our aligned check, let's see what happens if we compute
|
||||
\[
|
||||
\begin{aligned}
|
||||
& Bézier(t) = x_1(1-t)^3 + 3x_2(1-t)^2t + 3x_3(1-t)t^2 + x_4t^3 \\
|
||||
& Bézier^\prime(t) = a(1-t)^2 + 2b(1-t)t + ct^2\ \left\{ a=3(x_2-x_1),b=3(x_3-x_2),c=3(x_4-x_3) \right\} \\
|
||||
& Bézier^{\prime\prime}(t) = u(1-t) + vt\ \left\{ u=2(b-a),v=2(c-b) \right\}\
|
||||
& Bézier^\prime(t) = a(1-t)^2 + 2b(1-t)t + ct^2~ \left\{ a=3(x_2-x_1),b=3(x_3-x_2),c=3(x_4-x_3) \right\} \\
|
||||
& Bézier^{\prime\prime}(t) = u(1-t) + vt~\left\{ u=2(b-a),v=2(c-b) \right\}\
|
||||
\end{aligned}
|
||||
\]
|
||||
|
||||
@@ -75,7 +75,7 @@ That's a lot easier to work with: we see a fair number of terms that we can comp
|
||||
c = x_2 \cdot y_3 \\
|
||||
d = x_4 \cdot y_3
|
||||
\end{matrix}\right\}
|
||||
\ C(t) = (-3a + 2b + 3c - d)t^2 + (3a - b - 3c)t + (c - a)
|
||||
~C(t) = (-3a + 2b + 3c - d)t^2 + (3a - b - 3c)t + (c - a)
|
||||
\]
|
||||
|
||||
This is a plain quadratic curve, and we know how to solve *C(t) = 0*; we use the quadratic formula:
|
||||
@@ -86,7 +86,7 @@ This is a plain quadratic curve, and we know how to solve *C(t) = 0*; we use the
|
||||
y =& 3a - b - 3c \\
|
||||
z =& c - a
|
||||
\end{matrix}\right\}
|
||||
\ C(t) = 0 \ \Rightarrow\ t = \frac{-y \pm \sqrt{y^2 - 4 x z}}{2x}
|
||||
~C(t) = 0 ~\Rightarrow~t = \frac{-y \pm \sqrt{y^2 - 4 x z}}{2x}
|
||||
\]
|
||||
|
||||
We can easily compute this value *if* the discriminator isn't a negative number (because we only want real roots, not complex roots), and *if* *x* is not zero, because divisions by zero are rather useless.
|
||||
|
@@ -155,7 +155,7 @@ Deriving the two segments upon splitting a curve takes a few steps, and the high
|
||||
1 & t & t^2
|
||||
\end{bmatrix}
|
||||
\cdot
|
||||
\underset{we\ turn\ this...}{\underbrace{\kern 2.25em Z \cdot M \kern 2.25em}}
|
||||
\underset{we~turn~this...}{\underbrace{\kern 2.25em Z \cdot M \kern 2.25em}}
|
||||
\cdot
|
||||
\begin{bmatrix}
|
||||
P_1 \\ P_2 \\ P_3
|
||||
@@ -168,7 +168,7 @@ Deriving the two segments upon splitting a curve takes a few steps, and the high
|
||||
1 & t & t^2
|
||||
\end{bmatrix}
|
||||
\cdot
|
||||
\underset{...into\ this...}{\underbrace{ M \cdot M^{-1} \cdot Z \cdot M }}
|
||||
\underset{...into~this...}{\underbrace{ M \cdot M^{-1} \cdot Z \cdot M }}
|
||||
\cdot
|
||||
\begin{bmatrix}
|
||||
P_1 \\ P_2 \\ P_3
|
||||
@@ -182,7 +182,7 @@ Deriving the two segments upon splitting a curve takes a few steps, and the high
|
||||
\end{bmatrix}
|
||||
\cdot
|
||||
M
|
||||
\underset{...to\ get\ this!}{\underbrace{ \kern 1.25em \cdot \kern 1.25em Q \kern 1.25em \cdot \kern 1.25em}}
|
||||
\underset{...to~get~this!}{\underbrace{ \kern 1.25em \cdot \kern 1.25em Q \kern 1.25em \cdot \kern 1.25em}}
|
||||
\begin{bmatrix}
|
||||
P_1 \\ P_2 \\ P_3
|
||||
\end{bmatrix}
|
||||
|
@@ -32,7 +32,7 @@ The tangent is very useful for moving along a line, but what if we want to move
|
||||
\begin{array}{l}
|
||||
normal_x(t) = \hat{x}(t) \cdot \cos{\frac{\pi}{2}} - \hat{y}(t) \cdot \sin{\frac{\pi}{2}} = - \hat{y}(t) \\
|
||||
\\
|
||||
normal_y(t) = \underset{quarter\ circle\ rotation} {\underbrace{ \hat{x}(t) \cdot \sin{\frac{\pi}{2}} + \hat{y}(t) \cdot \cos{\frac{\pi}{2}} }} = \hat{x}(t)
|
||||
normal_y(t) = \underset{quarter~circle~rotation} {\underbrace{ \hat{x}(t) \cdot \sin{\frac{\pi}{2}} + \hat{y}(t) \cdot \cos{\frac{\pi}{2}} }} = \hat{x}(t)
|
||||
\end{array}
|
||||
\]
|
||||
|
||||
|
@@ -8,12 +8,12 @@ The general rule for raising an *n<sup>th</sup>* order curve to an *(n+1)<sup>th
|
||||
|
||||
\[
|
||||
Bézier(k,t) = \sum_{i=0}^{k}
|
||||
\underset{binomial\ term}{\underbrace{\binom{k}{i}}}
|
||||
\underset{binomial~term}{\underbrace{\binom{k}{i}}}
|
||||
\cdot\
|
||||
\underset{polynomial\ term}{\underbrace{(1-t)^{k-i} \cdot t^{i}}}
|
||||
\ \cdot \
|
||||
\underset{new\ weights}{\underbrace{\left ( \frac{(k-i) \cdot w_i + i \cdot w_{i-1}}{k} \right )}}
|
||||
\ ,\ with\ k = n+1\ and\ w_{i-1}=0\ when\ i = 0
|
||||
\underset{polynomial~term}{\underbrace{(1-t)^{k-i} \cdot t^{i}}}
|
||||
~\cdot \
|
||||
\underset{new~weights}{\underbrace{\left ( \frac{(k-i) \cdot w_i + i \cdot w_{i-1}}{k} \right )}}
|
||||
~,~with~k = n+1~and~w_{i-1}=0~when~i = 0
|
||||
\]
|
||||
|
||||
However, this rule also has as direct consequence that you **cannot** generally safely lower a curve from *n<sup>th</sup>* order to *(n-1)<sup>th</sup>* order, because the control points cannot be "pulled apart" cleanly. We can try to, but the resulting curve will not be identical to the original, and may in fact look completely different.
|
||||
|
@@ -11,7 +11,7 @@ Adding these ratio values to the regular Bézier curve function is fairly easy.
|
||||
The function for rational Bézier curves has two more terms:
|
||||
|
||||
\[
|
||||
Rational\ Bézier(n,t) = \frac{ \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot w_i \cdot BLUE[ratio_i] }{ BLUE[ \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot ratio_i ] }
|
||||
Rational~Bézier(n,t) = \frac{ \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot w_i \cdot BLUE[ratio_i] }{ BLUE[ \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot ratio_i ] }
|
||||
\]
|
||||
|
||||
In this, the first new term represents an additional weight for each coordinate. For example, if our ratio values are [1, 0.5, 0.5, 1] then <code>ratio<sub>0</sub> = 1</code>, <code>ratio<sub>1</sub> = 0.5</code>, and so on, and is effectively identical as if we were just using different weight. So far, nothing too special.
|
||||
|
@@ -9,12 +9,12 @@ If we know the distance between those two points, and we want a new point that i
|
||||
\[
|
||||
Given \left (
|
||||
\begin{aligned}
|
||||
p_1 &= some\ point \\
|
||||
p_2 &= some\ other\ point \\
|
||||
p_1 &= some~point \\
|
||||
p_2 &= some~other~point \\
|
||||
distance &= (p_2 - p_1) \\
|
||||
ratio &= \frac{percentage}{100} \\
|
||||
\end{aligned}
|
||||
\right ),\ our\ new\ point = p_1 + distance \cdot ratio
|
||||
\right ),~our~new~point = p_1 + distance \cdot ratio
|
||||
\]
|
||||
|
||||
So let's look at that in action: the following graphic is interactive in that you can use your up and down arrow keys to increase or decrease the interpolation ratio, to see what happens. We start with three points, which gives us two lines. Linear interpolation over those lines gives us two points, between which we can again perform linear interpolation, yielding a single point. And that point —and all points we can form in this way for all ratios taken together— form our Bézier curve:
|
||||
|
@@ -9,12 +9,12 @@
|
||||
\[
|
||||
Given \left (
|
||||
\begin{aligned}
|
||||
p_1 &= some\ point \\
|
||||
p_2 &= some\ other\ point \\
|
||||
p_1 &= some~point \\
|
||||
p_2 &= some~other~point \\
|
||||
distance &= (p_2 - p_1) \\
|
||||
ratio &= \frac{percentage}{100} \\
|
||||
\end{aligned}
|
||||
\right ),\ our\ new\ point = p_1 + distance \cdot ratio
|
||||
\right ),~our~new~point = p_1 + distance \cdot ratio
|
||||
\]
|
||||
|
||||
让我们来通过实际操作看一下:下面的图形都是可交互的,因此你可以通过上下键来增加或减少插值距离,来观察图形的变化。我们从三个点构成的两条线段开始。通过对各条线段进行线性插值得到两个点,对点之间的线段再进行线性插值,产生一个新的点。最终这些点——所有的点都可以通过选取不同的距离插值产生——构成了贝塞尔曲线
|
||||
|
After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
@@ -0,0 +1,11 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
__ n=3 n-k k
|
||||
B(t) = ❯ \ P \binomnk(1-t) t
|
||||
cubic ‾‾ k=0
|
||||
k
|
||||
|
||||
3 2 2 3
|
||||
= P (1-t) + 3 P (1-t) t + 3P (1-t)t + P t
|
||||
|
||||
0 1 2 3
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
3
|
||||
(1-t)
|
||||
u(t) = ───────────
|
||||
cubic 3 3
|
||||
t + (1-t)
|
@@ -0,0 +1,4 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
C = u(t) · P + (1-u(t)) · P
|
||||
start end
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
distance(B,C)
|
||||
ratio(t) = ───────────── = Constant
|
||||
distance(A,B)
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
C - B B - C
|
||||
A = B - ──────── = B + ────────
|
||||
ratio(t) ratio(t)
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
3 3
|
||||
t + (1-t) - 1
|
||||
ratio(t) = |───────────────|
|
||||
cubic 3 3
|
||||
t + (1-t)
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
2
|
||||
(1-t)
|
||||
u(t) = ───────────
|
||||
quadratic 2 2
|
||||
t + (1-t)
|
@@ -0,0 +1,10 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ v - start
|
||||
│ 1
|
||||
│ C '= start + ──────────
|
||||
╡ 1 t
|
||||
│ v - end
|
||||
│ 2
|
||||
│ C '= end + ────────
|
||||
╰ 2 1 - t
|
@@ -0,0 +1,10 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ A' - e
|
||||
│ 1
|
||||
│ v = A' - ───────
|
||||
╡ 1 1 - t
|
||||
│ A' - e
|
||||
│ 2
|
||||
│ v = A' - ───────
|
||||
╰ 2 t
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
2 2
|
||||
t + (1-t) - 1
|
||||
ratio(t) = |───────────────|
|
||||
quadratic 2 2
|
||||
t + (1-t)
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ 3 2 2 3
|
||||
╡ x = \colorblue120 · (1-t) \colorblue + 35 · 3 · (1-t) · t \colorblue + 220 · 3 · (1-t) · t \colorblue + 220 · t
|
||||
│ 3 2 2 3
|
||||
╰ y = \colorblue160 · (1-t) \colorblue + 200 · 3 · (1-t) · t \colorblue + 260 · 3 · (1-t) · t \colorblue + 40 · t
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ 3 2 2 3
|
||||
╡ x = \colorblue0 · (1-t) \colorblue - 85 · 3 · (1-t) · t \colorblue + 100 · 3 · (1-t) · t \colorblue + 100 · t
|
||||
│ 3 2 2 3
|
||||
╰ y = \colorblue0 · (1-t) \colorblue + 40 · 3 · (1-t) · t \colorblue + 100 · 3 · (1-t) · t \colorblue - 120 · t
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ 2 2 3
|
||||
╡ x = \colorblue - 85 · 3 · (1-t) · t \colorblue - 12 · 3 · (1-t) · t \colorblue + 156 · t
|
||||
│ 2 2
|
||||
╰ y = \colorblue - 40 · 3 · (1-t) · t \colorblue + 140 · 3 · (1-t) · t
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ 3 2 2 3
|
||||
╡ x = \colorblue0 · (1-t) \colorblue - 85 · 3 · (1-t) · t \colorblue - 12 · 3 · (1-t) · t \colorblue + 156 · t
|
||||
│ 3 2 2 3
|
||||
╰ y = \colorblue0 · (1-t) \colorblue - 40 · 3 · (1-t) · t \colorblue + 140 · 3 · (1-t) · t \colorblue + 0 · t
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌─────────────────┐
|
||||
╭ z │ 2 2 z ┌ ╭ z -1 z ╮ ╭ z 1 z ╮ ┐
|
||||
| ⟍│(dx/dt) +(dy/dt) dt ≃ ─ · │ f│ ─ · ──── + ─ │ + f│ ─ · ──── + ─ │ │
|
||||
╯ 0 2 │ │ 2 ┌─┐ 2 │ │ 2 ┌─┐ 2 │ │
|
||||
└ ╰ ⟍│3 ╯ ╰ ⟍│3 ╯ ┘
|
@@ -0,0 +1,12 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌─────────────────┐
|
||||
╭ z │ 2 2
|
||||
| ⟍│(dx/dt) +(dy/dt) dt
|
||||
╯ 0
|
||||
z ┌ ╭ z z ╮ ╭ z z ╮ ┐
|
||||
≃ \ ─ · │ C · f│ ─ · t + ─ │ + ... + C · f│ ─ · t + ─ │ │
|
||||
2 └ 1 ╰ 2 1 2 ╯ n ╰ 2 n 2 ╯ ┘
|
||||
z __ n ╭ z z ╮
|
||||
= \ ─ · ❯ C · f│ ─ · t + ─ │
|
||||
2 ‾‾ i=1 i ╰ 2 i 2 ╯
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌─────────────────┐
|
||||
╭ z │ 2 2
|
||||
length = | ⟍│(dx/dt) +(dy/dt) dt
|
||||
╯ 0
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌───────────────┐
|
||||
╭ z │ 2 2
|
||||
| │f '(t) +f '(t) dt
|
||||
╯ 0⟍│ x y
|
@@ -0,0 +1,14 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
C = 1
|
||||
1
|
||||
C = 1
|
||||
2
|
||||
1
|
||||
t = - ────
|
||||
1 ┌─┐
|
||||
⟍│3
|
||||
1
|
||||
t = + ────
|
||||
2 ┌─┐
|
||||
⟍│3
|
@@ -0,0 +1,9 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌─────────────────┐
|
||||
╭ 1 │ 2 2 ╭ 1
|
||||
| ⟍│(dx/dt) +(dy/dt) dt = | f(t) dt ≃ ┌ \undersetstrip 1 \underbrace C · f(t ) + ... + \undersetstrip n \underbrace C · f(t ) ┐ =
|
||||
╯ -1 ╯ -1 └ 1 1 n n ┘
|
||||
__ n
|
||||
\undersetstrips 1 through n \underbrace ❯ C · f(t )
|
||||
‾‾ i=1 i i
|
@@ -0,0 +1,30 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ ╭ ╭ 1 0 0
|
||||
│ │ │ α × d , with d either 0 or 1
|
||||
│ │ 2 1 1 │ 3 3 3
|
||||
│ │ α × d , with d = ╡ +
|
||||
│ │ 3 3 3 │ ╭ 1 ╮ 0 0
|
||||
│ │ │ │ 1 - α │ × d , with d either 0 or 1
|
||||
│ 3 2 2 │ ╰ ╰ 3 ╯ 2 2
|
||||
│ α × d , with d = ╡ +
|
||||
│ 3 3 3 │ ╭ 1 0
|
||||
│ │ │ α × d
|
||||
│ │ ╭ 2 ╮ 1 1 │ 2 2
|
||||
│ │ │ 1 - α │ × d , with d = ╡ +
|
||||
3 │ │ ╰ 3 ╯ 2 2 │ ╭ 1 ╮ 0 0
|
||||
d = ╡ │ │ │ 1 - α │ × d , with d either 0 or 1
|
||||
3 │ ╰ ╰ ╰ 2 ╯ 1 1
|
||||
│ +
|
||||
│ ╭ 2 1
|
||||
│ │ α × d
|
||||
│ │ 2 2
|
||||
│ │
|
||||
│ ╭ 3 ╮ 2 2 │ +
|
||||
│ │ 1 - α │ × d , with d = ╡ ╭ 1 0
|
||||
│ ╰ 3 ╯ 2 2 │ │ α × d
|
||||
│ │ ╭ 2 ╮ 1 1 │ 1 1
|
||||
│ │ │ 1 - α │ × d , with d = ╡ +
|
||||
│ │ ╰ 2 ╯ 1 1 │ ╭ 1 ╮ 0 0
|
||||
│ │ │ │ 1 - α │ × d , with d either 0 or 1
|
||||
╰ ╰ ╰ ╰ 1 ╯ 0 0
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
__ n
|
||||
Point(t) = ❯ P · N (t)
|
||||
‾‾ i=0 i i,k
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
k 0 ╭ 1 if t ∈[knot ,knot )
|
||||
d (t) = 0, d (t) = N (t) = ╡ i i+1
|
||||
0 i i,1 ╰ 0 otherwise
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
t - knots[i]
|
||||
α = ─────────────────────────
|
||||
i,k knots[i+1+n-k] - knots[i]
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ t-knot ╮ ╭ knot -t ╮
|
||||
│ i │ │ (i+k) │
|
||||
N (t) = │ ─────────────────── │ · N (t) + │ ───────────────────── │ · N (t)
|
||||
i,k │ knot - knot │ i,k-1 │ knot - knot │ i+1,k-1
|
||||
╰ (i+k-1) i ╯ ╰ (i+k) (i+1) ╯
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ 1 if t ∈[knot ,knot )
|
||||
N (t) = ╡ i i+1
|
||||
i,1 ╰ 0 otherwise
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
k k-1 k-1
|
||||
d (t) = α · d (t) + (1-α ) · d (t)
|
||||
i i,k i i,k i-1
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌ 1 S 0 ┐ ┌ x ┐ ┌ x + S · y ┐
|
||||
│ 0 1 0 │ · │ y │ = │ y │
|
||||
└ 0 0 1 ┘ └ 1 ┘ └ 1 ┘
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
2
|
||||
-x + 3x
|
||||
y = ────────, { x ≤0 }
|
||||
3
|
@@ -0,0 +1,13 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
╭ x · y x · y ╮
|
||||
│ 2 4 2 3 │
|
||||
│ x - ──────── / x -──────── │ ╭ x ╮
|
||||
│ 4 y 3 y │ │ 43 │ ╭ x · y x · y ╮
|
||||
│ 2 2 │ │ │ │ 2 4 2 3 │
|
||||
... = │ │ = │ y ╭ y ╮ │, where x = │ x - ──────── \middle / x -──────── │
|
||||
│ y ╭ y ╮ ╭ x · y x · y ╮ │ │ 4 │ 3 │ │ 43 │ 4 y 3 y │
|
||||
│ 4 │ 3 │ │ 2 4 2 3 │ │ │ ── + x │ 1 - ── │ │ ╰ 2 2 ╯
|
||||
│ ── + │ 1 - ── │ · │ x - ──────── / x -──────── │ │ │ y 43 │ y │ │
|
||||
│ y │ y │ │ 4 y 3 y │ │ ╰ 2 ╰ 2 ╯ ╯
|
||||
╰ 2 ╰ 2 ╯ ╰ 2 2 ╯ ╯
|
@@ -0,0 +1,6 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
2
|
||||
-x + 2x + 3
|
||||
y = ────────────, { x ≤1 }
|
||||
4
|
@@ -0,0 +1,7 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌──────────┐
|
||||
│ 2
|
||||
⟍│3(4x - x ) - x
|
||||
y = ─────────────────, { 0 ≤x ≤1 }
|
||||
2
|
@@ -0,0 +1,5 @@
|
||||
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
|
||||
|
||||
┌ 1 0 a ┐ ┌ x ┐ ┌ 1 · x + 0 · y + a · z ┐ ┌ x + a · 1 ┐ ┌ x + a ┐
|
||||
│ 0 1 b │ · │ y │ = │ 0 · x + 1 · y + b · z │ = │ y + b · 1 │ = │ y + b │
|
||||
└ 0 0 1 ┘ └ z=1 ┘ └ 0 · x + 0 · y + 1 · z ┘ └ 1 · z ┘ └ z=1 ┘
|