Closed luc4leone closed 2 years ago
The first set looks like it uses notation that matched a previous graphic, those primes shouldn't be there (fixed in https://github.com/Pomax/BezierInfo-2/commit/e89f11a84a8bd7e7eb22b4a666d36e172cbbac8c). As for the second function, what part is not clear? Those are the v1 and v2 values that we computed two lines up, and is further explained by looking at the graphic again, which explains what e1/e2 and v1/v2 are.
The formula are just the math expressions for the already stated natural English descriptions of what we see in the graphic:
e1--A
represents the 1-t
part of the line segment from v1 to A (because that's how Bezier curves are geometrically constructed), we know that v1 lies at a distance (A-e1) / (1-t)
from A.t
instead of 1-t
because e2--A
represents the t
of the line segment from v2 to A.And the same applies to the control points. Looking at the graphic, we can express "where they can be found" in terms of distances from the start/end point based on the distances between start--v1
and end--v2
and the fact that those distances represent t
and 1-t
fractions respectively of the "line segments to the control points".
Hey @Pomax, first of all thanks. A couple of questions.
If
e1 = (1-t)*v1 + t*A
I get calculate v1 in a couple of steps:
e1 - t*A = (1-t)*v1
then
e1 - t*A / 1-t = v1
which is different from
where's my mistake?
For cubic curves, there is no single pair of points that can act as e1 and e2
what do you mean exactly?
1) that's a good point, it looks like that formula for v1/v2 isn't correct, and should be updated. However, note that you do have a mistake: if e1 - t*A = (1-t)*v1
then that becomes (e1 - t*A) / (1-t) = v1
, not e1 - t*A / (1-t) = v1
.
2) note that the text doesn't say "there is no pair of points", but "there is no single pair of points". There are infinitely many pairs of e1 and e2 that we could use, each yielding a different final curve, based on the fact that the tangent at B is not fixed for cubic curves (unlike for quadratic curves), so it's up to us as designers/implementers to pick what seems a reasonable pair with which to perform the curve construction.
Updates in https://github.com/Pomax/BezierInfo-2/commit/272af23fe42663241e392eebc30764d84e958e86
then that becomes
(e1 - t*A) / (1-t) = v1
, note1 - t*A / (1-t) = v1
absolutely, I missed the parenthesis, but yeah, what you wrote is what was on my mind, my bad!
In section 30
@Pomax the above is not clear to me and I feel it's crucial to understand, can you please elaborate it further?
Also: