@@ -566,7 +566,7 @@
thus 80% the distance away from the second point) then we can compute that really easily:
@@ -631,7 +631,7 @@ f(x) = cos (x)
So far, so good. Now, let's look at parametric functions, and how they cheat. Let's take the following two functions:
@@ -642,9 +642,9 @@ f(b) = sin (b)
function. Parametric functions cheat by changing that. In a parametric function all the different functions share a variable, like this:
@@ -662,8 +662,8 @@ f(b) = sin (b)
obvious:
@@ -691,7 +691,7 @@ f(b) = sin (b)
You may remember polynomials from high school. They're those sums that look like this:
@@ -712,12 +712,12 @@ f(x) = a · x + b · x + c · x + d
values:
@@ -1083,11 +1083,11 @@ Bézier(n,t) = ❯ \underset binomial term\underbrace\binomni · \ \unders
(210,30), we use this Bézier curve:
Which gives us the curve we saw at the top of the article:
@@ -1208,9 +1208,9 @@ function Bezier(3,t,w[]):
Adding these ratio values to the regular Bézier curve function is fairly easy. Where the regular function is the following:
The function for rational Bézier curves has two more terms:
@@ -1423,8 +1423,8 @@ mixture = a · value + b · value
And that's easy:
@@ -1494,61 +1494,61 @@ m = a · value + (1 - a) · value
refer to coordinate values "in one or more dimensions":
Disregarding our actual coordinates for a moment, we have:
We can write this as a sum of four expressions:
And we can expand these expressions:
Furthermore, we can make all the 1 and 0 factors explicit:
And that, we can view as a series of four matrix operations:
@@ -2535,7 +2535,7 @@ Bézier(n,t) = ❯ w B (t) , where B (t) = \binomni · (1-t) · t
t
and 1-t
:
@@ -2544,9 +2544,9 @@ x = 1 x = ((1-t) + t) x = (1-t) x + t x = x (1-t) + x t
t
component:
@@ -2556,18 +2556,18 @@ Bézier(n,t)= (1-t) B(n,t) + t B(n,t)
I promise, it's about to make sense. We start with (1-t)
:
t part, but that's not a problem:
Let's do this:
where the matrix M is an n+1
by n
matrix, and looks like:
First, let's look at the derivative rule for Bézier curves, which is:
n) as:
n-1 and k-1, we'll be on the right track.
And that's just a summation of lower order curves:
@@ -2979,7 +2979,7 @@ Bézier (t) ── = n · B (t) · (w - w ) + n · B
/>
We can rewrite this as a normal summation, and we're done:
@@ -3084,14 +3084,14 @@ tangent (t) = B' (t)
point, and then do whatever it is we want to do based on those directions:
@@ -3153,7 +3153,7 @@ y' = x · sin (\phi) + y · cos (\phi)
/>
Which is the "long" version of the following matrix transformation:
@@ -3616,10 +3616,10 @@ generateRMFrames(steps) -> frames:
derivatives section:
And then we turn this into our solution for t
using basic arithmetics:
@@ -3656,7 +3656,7 @@ B'(t) = a(1-t) + b(t)= 0,
you haven't, it looks like this:
@@ -3696,21 +3696,21 @@ B'(t) uses { v ,v ,v }, where v = 3(p -p ), v = 3(p -p ), v = 3(p -p )
/>
And then, using these v values, we can find out what our a, b, and c should be:
fy(x) is zero, so that the next t
is the same as the one we already have:
@@ -4312,11 +4312,11 @@ x = x - ───────
by -160, gives us:
@@ -4324,20 +4324,20 @@ x = x - ───────
become:
If we drop all the zero-terms, this gives us:
@@ -4418,7 +4418,7 @@ x = x - ───────
What we need to do is solve a simple equation:
@@ -4428,7 +4428,7 @@ C(t) = 0
circle being on the other side of the curve. So what does C(t) look like? Actually something that seems not too hard:
@@ -4457,15 +4457,15 @@ C(t) = Bézier \prime(t) · Bézier \prime\prime(t) - Bézier \prime(t)
with the first and second derivatives, given our basis functions:
And of course the same functions for y:
t values, we end up with the following simple term function for C(t):
@@ -4981,16 +4981,16 @@ mapped = (x) = │ 1 2
First, let's look at the function for x(t):
We can rewrite this to a plain polynomial form, by just fully writing out the expansion and then collecting the polynomial factors, as:
@@ -5001,7 +5001,7 @@ x(t) = (-a + 3b- 3c + d)t + (3a - 6b + 3c)t + (-3a + 3b)t + a
known constants, we can trivially rewrite this (by moving the x(t)
across the equal sign) as:
@@ -5085,7 +5085,7 @@ y = curve.get(t).y
@@ -5197,16 +5197,16 @@ length = | ⟍│(dx/dt) +(dy/dt) dt
shifting and scaling the inputs. Doing so, we get the following:
these tables would tell us that for n=2 we must use the following values:
@@ -5410,14 +5410,14 @@ t = + ────
tiny bit:
@@ -5494,7 +5494,7 @@ function kappa(t, B):
circle that "fits" the curve's curvature at any point, using what is possibly the simplest bit of maths found in this entire primer:
@@ -5912,22 +5912,22 @@ C = u(t) · P + (1-u(t)) · P
(with thanks to Boris Zbarsky) shows us the following two formulae:
And
@@ -5938,7 +5938,7 @@ u(t) = ───────────
We start by observing that, given A
, B
, and C
, the following always holds:
And
@@ -5971,7 +5971,7 @@ ratio(t) = |───────────────|
ratio(t)
function to find A
:
@@ -6034,15 +6034,15 @@ A = B - ───────── = B + ─────────
B
point, and B
and end point as a ratio, using
e2 coordinates must obey the standard de Casteljau rule for linear interpolation:
@@ -6112,7 +6112,7 @@ A = B - ───────── = B + ─────────
curve with a loop in it. To do this, we can use the atan2 function:
@@ -6129,8 +6129,8 @@ A = B - ───────── = B + ─────────
d
:
Which seems simple enough. Unfortunately, when we expand that dist
function, things get a lot more problematic:
B, we can compute the associated C
:
And then the associated A
:
@@ -6708,12 +6708,12 @@ A = B - ────────── = B + ──────────
form, where each line corresponds to a power of t, and each column is for a specific coefficient. First, we expand the function:
And then we (trivially) rearrange the terms across multiple lines:
With that arrangement, we can easily decompose this as a matrix multiplication:
So we write out the expansion and rearrange:
Which we can then decompose:
@@ -6889,10 +6889,10 @@ D = ┌ d d ... d ┐, where ╡ 1
i=n
fall in the [0,1] interval, so we need to scale all values down by whatever the total length of the polygon is:
T x M x C we talked about before, which gives us:
In which we can replace the rather cumbersome "squaring" operation with a more conventional matrix equivalent:
@@ -6985,7 +6985,7 @@ E(C) = (P - TMC) (P - TMC)
those, and then use that 𝕋 instead of T in our error function:
@@ -7042,7 +7042,7 @@ E(C) = (P - 𝕋MC) (P - 𝕋MC)
taking the derivative, and determining where that derivative is zero:
@@ -7164,13 +7164,13 @@ C = M (𝕋 𝕋) 𝕋 P
previous and next point:
@@ -7951,7 +7951,7 @@ B'(1) = B'(0)
last control point through the last on-curve point. And mirroring any point A through any point B is really simple:
B(t). Easy enough:
N(t) always has length 1, which we can achieve by dividing B'(t)
by its magnitude:
B'(t), with t = 0
as start and t = 1
as end:
φ:
First we solve for b:
which yields:
@@ -8450,7 +8450,7 @@ b = ────────
polynomial, and we know where the circle arc's actual point P is for angle φ/2:
2" (which is "half height" P2), and so forth:
Wolfram Alpha is definitely the way to go. That said, let's get going:
k:
Which also gives us the commonly found value of 0.55228 for quarter circles, based on them having an angle of half π:
First, let's express the total error (given circular arc angle θ, and some k) using standard calculus notation:
@@ -9541,7 +9541,7 @@ N (t) = ╡ i i+1
P(t), we can compute this point by evaluating d(t) on a curve section between knots i
and i+1
:
@@ -9582,34 +9582,34 @@ d (t) = 0, d (t) = N (t) = ╡ i i+1
recursion diagram:
diff --git a/docs/ko-KR/index.html b/docs/ko-KR/index.html
index 7ec8933f..4d4abe7e 100644
--- a/docs/ko-KR/index.html
+++ b/docs/ko-KR/index.html
@@ -183,7 +183,7 @@
3GY1HbQ2cH9V4xBLnRYdEfc42Nd1ZyjLZu
or use the QR code on the right, if that's the kind of convenience you prefer =)
-
+