diff --git a/docs/chapters/circleintersection/circle.js b/docs/chapters/circleintersection/circle.js index eb4463a6..2a746853 100644 --- a/docs/chapters/circleintersection/circle.js +++ b/docs/chapters/circleintersection/circle.js @@ -5,7 +5,7 @@ let curve; setup() { curve = Bezier.defaultCubic(this); setMovable(curve.points); - setSlider(`.slide-control`, `radius`, 102); + setSlider(`.slide-control`, `radius`, 70); } draw() { @@ -86,9 +86,18 @@ findClosest(x, y, LUT, pd2, pd1, distanceEpsilon = 5) { drawProjection(x, y, LUT, i) { let B = refineBinary(curve, x, y, LUT, i, this.radius); - setColor(`rgba(100,100,255)`); - circle(B.x, B.y, 3); - line(B.x, B.y, x, y); + + // Our initial guess might actually not be close enough, + // so it's possible that after binary refining, it turns + // out the local minimum is actually still too far away + // to count. In that case B will be undefined, so we need + // to make sure to check before we draw it. + + if (B) { + setColor(`rgba(100,100,255)`); + circle(B.x, B.y, 3); + line(B.x, B.y, x, y); + } } onMouseMove() { diff --git a/docs/chapters/circleintersection/content.en-GB.md b/docs/chapters/circleintersection/content.en-GB.md index cd39064e..5cc69bfc 100644 --- a/docs/chapters/circleintersection/content.en-GB.md +++ b/docs/chapters/circleintersection/content.en-GB.md @@ -11,7 +11,7 @@ First, we observe that "finding intersections" in this case means that, given a Which seems simple enough. Unfortunately, when we expand that `dist` function, things get a lot more problematic: \[ - \begin{array}{cl} + \begin{aligned} r &= dist(B(t), c) \\ &= \sqrt{ \left ( B_x{t} - c_x \right )^2 + \left ( B_y{t} - c_y \right )^2} \\ &= \sqrt{ \left ( @@ -21,7 +21,7 @@ Which seems simple enough. Unfortunately, when we expand that `dist` function, t \left ( y_1 (1-t)^3 + 3 y_2 (1-t)^2 t + 2 y_3 (1-t) t^2 + y_4 t^3 - c_y \right )^2} - \end{array} + \end{aligned} \] And now we have a problem because that's a sixth degree polynomial inside the square root. So, thanks to the [Abel-Ruffini theorem](https://en.wikipedia.org/wiki/Abel%E2%80%93Ruffini_theorem) that we saw before, we can't solve this by just going "square both sides because we don't care about signs"... we can't solve a sixth degree polynomial. So, we're going to have to actually evaluate that expression. We can "simplify" this by translating all our coordinates so that the center of the circle is (0,0) and all our coordinates are shifted accordingly, which makes the cx and cy terms fall away, but then we're still left with a monstrous function to solve. @@ -29,7 +29,7 @@ And now we have a problem because that's a sixth degree polynomial inside the sq So instead, we turn to the same kind of "LUT walking" that we saw for projecting points onto a curve, with a twist: instead of finding the on-curve point with the smallest distance to our projection point, we want to find the on-curve point that has the exact distance `r` to our projection point (namely, our circle center). Of course, there can be more than one such point, so there's also a bit more code to make sure we find all of them, but let's look at the steps involved: ``` -c = our circle's center point +p = our circle's center point r = our circle's radius d = some initially huge value i = 0 @@ -40,18 +40,21 @@ for (coordinate, index) in LUT: i = index ``` -This is _very_ similar to the code in the previous section, but adapted so that we home in on points with an exact distance, rather than "the smallest distance". So far so good. However, we also want to make sure we find _all_ the points, not just a single one, so we need a little more code for that: +This is _very_ similar to the code in the previous section, with an extra input `r` for the circle radius, and a minor change in the "distance for this coordinate": rather than just `distance(coordinate, p)` we want to know the difference between that distance and the circle radius. After all, if that difference is zero, then the distance from the coordinate to the circle center is exactly the radius, so the coordinate lies on both the curve and the circle. + +So far so good. + +However, we also want to make sure we find _all_ the points, not just a single one, so we need a little more code for that: ``` -c = our circle's center point +p = our circle's center point r = our circle's radius d = some initially huge value start = 0 values = [] -run: - i = findClosest(start, x, y, r, LUT) - if (i < start) stop - if (i>0 && i === start) stop +do: + i = findClosest(start, p, r, LUT) + if i < start, or i>0 but the same as start: stop values.add(i); start = i + 2; ``` @@ -59,31 +62,32 @@ run: After running this code, `values` will be the list of all LUT coordinates that are closest to the distance `r`: we can use those values to run the same kind of refinement lookup we used for point projection (with the caveat that we're now _not_ checking for smallest distance, but for "distance closest to `r`"), and we'll have all our intersection points. Of course, that does require explaining what `findClosest` does: rather than looking for a global minimum, we're now interested in finding a _local_ minimum, so instead of checking a single point and looking at its distance value, we check _three_ points ("current", "previous" and "before previous") and then check whether they form a local minimum: ``` -findClosest(start, x, y, r, LUT): - D = some very large number - pd2 = LUT[start-2], if it exists. Otherwise use D - pd1 = LUT[start-1], if it exists. Otherwise use D +findClosest(start, p, r, LUT): + minimizedDistance = some very large number + pd2 = LUT[start-2], if it exists. Otherwise use minimizedDistance + pd1 = LUT[start-1], if it exists. Otherwise use minimizedDistance slice = LUT.subset(start, LUT.length) epsilon = the largest point-to-point distance in our LUT i = -1; - for (point, index) in slice: - q = abs(dist(point, (x,y)) - r); - if pd1 < epsilon && pd2 > pd1 && pd1 < q: + for (coordinate, index) in slice: + q = abs(dist(coordinate, p) - r); + if pd1 less than all three values epsilon, pd2, and q: i = index - 1 break - if q < D: D = q - + minimizedDistance = min(q, minimizedDistance) pd2 = pd1 pd1 = q return start + i ``` -In words: given a `start` index, the circles `x`, `y`, and `r` values, and our LUT, we check where, closest to out `start` index, we can find a local minimum for the difference between the distance to the circle center, and the circle's radius value. We track this over three points, and we know we've found a local minimum if the distances `{pd2, pd1, index}` show that the middle value (`pd1`) is lower than the values on either side. When we do, we can set our "best guess related to `start`" as the index that belongs to that `pd1`. Of course, since we're not checking values relative to some `start` value, we might not find another candidate value at all, in which case we return `start - 1`, so that a simple "is the result less than `start`?" lets us determine that there are no more intersections to find. +In words: given a `start` index, the circle center and radius, and our LUT, we check where (closest to out `start` index) we can find a local minimum for the difference between "the distance from the curve to the circle center", and the circle's radius. We track this by looking at three values (associated with the indices `index-2`, `index-1`, and `index`), and we know we've found a local minimum if the three values show that the middle value (`pd1`) is less than either value beside it. When we do, we can set our "best guess, relative to `start`" as `index-1`. Of course, since we're now checking values relative to some `start` value, we might not find another candidate value at all, in which case we return `start - 1`, so that a simple "is the result less than `start`?" lets us determine that there are no more intersections to find. -So, the following graphic shows this off for the standard cubic curve (which you can move the coordinates around for, of course) and a circle with a controllable radius centered on the graphic's center, using the code approach described above. +Finally, while not necessary for point projection, there is one more step we need to perform when we run the binary refinement function on our candidate LUT indices, because we've so far only been testing using distances "closest to the radius of the circle", and that's actually not good enough... we need distances that _are_ the radius of the circle. So, after running the refinement for each of these indices, we need to discard any final value that isn't the circle radius. And because we're working with floating point numbers, what this really means is that we need to discard any value that's a pixel or more "off". Or, if we want to get really fancy, "some small `epsilon` value". + +Based on all of that, the following graphic shows this off for the standard cubic curve (which you can move the coordinates around for, of course) and a circle with a controllable radius centered on the graphic's center, using the code approach described above. diff --git a/docs/chapters/projections/content.en-GB.md b/docs/chapters/projections/content.en-GB.md index 8d181ea8..b28a0f5f 100644 --- a/docs/chapters/projections/content.en-GB.md +++ b/docs/chapters/projections/content.en-GB.md @@ -9,8 +9,9 @@ p = some point to project onto the curve d = some initially huge value i = 0 for (coordinate, index) in LUT: - if distance(coordinate, p) < d: - d = distance(coordinate, p) + q = distance(coordinate, p) + if q < d: + d = q i = index ``` diff --git a/docs/chapters/projections/refine-binary.js b/docs/chapters/projections/refine-binary.js index b21c5cc6..2d7d58d0 100644 --- a/docs/chapters/projections/refine-binary.js +++ b/docs/chapters/projections/refine-binary.js @@ -1,10 +1,5 @@ -function abs(v) { - return v<0 ? -v : v; -} - -function dist(x1,y1,x2,y2) { - return ((x1-x2)**2 + (y2-y1)**2) ** 0.5; -} +const abs = v => v<0 ? -v : v; +const dist = (x1,y1,x2,y2) => ((x1-x2)**2 + (y2-y1)**2) ** 0.5; /* We already know that LUT[i1] and LUT[i2] are *not* good distances, @@ -13,7 +8,7 @@ function dist(x1,y1,x2,y2) { five points, and then check which three of those five are a new, better, interval to check within. */ -function refineBinary(curve, x, y, LUT, i, targetDistance=0) { +function refineBinary(curve, x, y, LUT, i, targetDistance=0, epsilon=1) { let q = LUT[i], count = 1, distance = Number.MAX_SAFE_INTEGER; @@ -49,6 +44,12 @@ function refineBinary(curve, x, y, LUT, i, targetDistance=0) { // always better than while(true). Never use while(true) } while (count++ < 25); + // If we're trying to hit a target, discard the result if + // it is not close enough to the target. + if (targetDistance && distance > epsilon) { + q = undefined; + } + return q; } diff --git a/docs/images/chapters/circleintersection/3a3ea30971de247da93034de614a63a4.png b/docs/images/chapters/circleintersection/3a3ea30971de247da93034de614a63a4.png new file mode 100644 index 00000000..7392de5b Binary files /dev/null and b/docs/images/chapters/circleintersection/3a3ea30971de247da93034de614a63a4.png differ diff --git a/docs/images/chapters/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.svg b/docs/images/chapters/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.svg new file mode 100644 index 00000000..f916f7ea --- /dev/null +++ b/docs/images/chapters/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/images/chapters/circleintersection/699e6ea5bffbe8fe377af21a2bd28532.svg b/docs/images/chapters/circleintersection/699e6ea5bffbe8fe377af21a2bd28532.svg deleted file mode 100644 index f730e95e..00000000 --- a/docs/images/chapters/circleintersection/699e6ea5bffbe8fe377af21a2bd28532.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/images/chapters/circleintersection/9271faa4684904073127482aa91e3bce.svg b/docs/images/chapters/circleintersection/9271faa4684904073127482aa91e3bce.svg deleted file mode 100644 index 8f21f4c5..00000000 --- a/docs/images/chapters/circleintersection/9271faa4684904073127482aa91e3bce.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/images/chapters/circleintersection/b480dae093b572dc707b76eef7fbca04.svg b/docs/images/chapters/circleintersection/b480dae093b572dc707b76eef7fbca04.svg deleted file mode 100644 index 22aa896f..00000000 --- a/docs/images/chapters/circleintersection/b480dae093b572dc707b76eef7fbca04.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/images/chapters/circleintersection/ee119fad4c48f5e17871ff31268cf8cc.png b/docs/images/chapters/circleintersection/ee119fad4c48f5e17871ff31268cf8cc.png deleted file mode 100644 index ec9f1a20..00000000 Binary files a/docs/images/chapters/circleintersection/ee119fad4c48f5e17871ff31268cf8cc.png and /dev/null differ diff --git a/docs/images/chapters/projections/0355c49e274b149298d2219dadfdbd0e.png b/docs/images/chapters/projections/0355c49e274b149298d2219dadfdbd0e.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/0355c49e274b149298d2219dadfdbd0e.png and /dev/null differ diff --git a/docs/images/chapters/projections/08ea4c82c706964f888a773c7d88ff13.png b/docs/images/chapters/projections/08ea4c82c706964f888a773c7d88ff13.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/08ea4c82c706964f888a773c7d88ff13.png and /dev/null differ diff --git a/docs/images/chapters/projections/139b484e614fe95dede12ff925442d76.png b/docs/images/chapters/projections/139b484e614fe95dede12ff925442d76.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/139b484e614fe95dede12ff925442d76.png and /dev/null differ diff --git a/docs/images/chapters/projections/15c510ad6c8d8ca4869d1069f9ed2334.png b/docs/images/chapters/projections/15c510ad6c8d8ca4869d1069f9ed2334.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/15c510ad6c8d8ca4869d1069f9ed2334.png and /dev/null differ diff --git a/docs/images/chapters/projections/16712d894e1547eada37cae6049e208d.png b/docs/images/chapters/projections/16712d894e1547eada37cae6049e208d.png deleted file mode 100644 index d473bf64..00000000 Binary files a/docs/images/chapters/projections/16712d894e1547eada37cae6049e208d.png and /dev/null differ diff --git a/docs/images/chapters/projections/18d59cae906be801358b7c33af50d57a.png b/docs/images/chapters/projections/18d59cae906be801358b7c33af50d57a.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/18d59cae906be801358b7c33af50d57a.png and /dev/null differ diff --git a/docs/images/chapters/projections/20ec29b2d53af9e205b6fead5e2d4cc3.png b/docs/images/chapters/projections/20ec29b2d53af9e205b6fead5e2d4cc3.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/20ec29b2d53af9e205b6fead5e2d4cc3.png and /dev/null differ diff --git a/docs/images/chapters/projections/2bd8655fc5430a71980d8d8fe48c28a5.png b/docs/images/chapters/projections/2bd8655fc5430a71980d8d8fe48c28a5.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/2bd8655fc5430a71980d8d8fe48c28a5.png and /dev/null differ diff --git a/docs/images/chapters/projections/3636ac81a158fa6bb63718e68b717cb3.png b/docs/images/chapters/projections/3636ac81a158fa6bb63718e68b717cb3.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/3636ac81a158fa6bb63718e68b717cb3.png and /dev/null differ diff --git a/docs/images/chapters/projections/3a0d972f3adb7958386a97332565cab3.png b/docs/images/chapters/projections/3a0d972f3adb7958386a97332565cab3.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/3a0d972f3adb7958386a97332565cab3.png and /dev/null differ diff --git a/docs/images/chapters/projections/3cc334d0ebc01cc5352e23ed47bc5414.png b/docs/images/chapters/projections/3cc334d0ebc01cc5352e23ed47bc5414.png deleted file mode 100644 index 502788bd..00000000 Binary files a/docs/images/chapters/projections/3cc334d0ebc01cc5352e23ed47bc5414.png and /dev/null differ diff --git a/docs/images/chapters/projections/3ee7ca14d6a8aca27dc6934658a38ad1.png b/docs/images/chapters/projections/3ee7ca14d6a8aca27dc6934658a38ad1.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/3ee7ca14d6a8aca27dc6934658a38ad1.png and /dev/null differ diff --git a/docs/images/chapters/projections/43960c40314c4ae04b45c6f18afcc8e9.png b/docs/images/chapters/projections/43960c40314c4ae04b45c6f18afcc8e9.png deleted file mode 100644 index d473bf64..00000000 Binary files a/docs/images/chapters/projections/43960c40314c4ae04b45c6f18afcc8e9.png and /dev/null differ diff --git a/docs/images/chapters/projections/4540c929bffd9d6c11b132ac0483f7a9.png b/docs/images/chapters/projections/4540c929bffd9d6c11b132ac0483f7a9.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/4540c929bffd9d6c11b132ac0483f7a9.png and /dev/null differ diff --git a/docs/images/chapters/projections/49e0e44e87da1aadf3b4c46a6fa2cd0e.png b/docs/images/chapters/projections/49e0e44e87da1aadf3b4c46a6fa2cd0e.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/49e0e44e87da1aadf3b4c46a6fa2cd0e.png and /dev/null differ diff --git a/docs/images/chapters/projections/52c076a3afafffc702fbbbcf30960dd5.png b/docs/images/chapters/projections/52c076a3afafffc702fbbbcf30960dd5.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/52c076a3afafffc702fbbbcf30960dd5.png and /dev/null differ diff --git a/docs/images/chapters/projections/530f69b3f3470227b5084e644c453e4b.png b/docs/images/chapters/projections/530f69b3f3470227b5084e644c453e4b.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/530f69b3f3470227b5084e644c453e4b.png and /dev/null differ diff --git a/docs/images/chapters/projections/53dd89fde74b84ae962a6fd921973a3f.png b/docs/images/chapters/projections/53dd89fde74b84ae962a6fd921973a3f.png deleted file mode 100644 index 502788bd..00000000 Binary files a/docs/images/chapters/projections/53dd89fde74b84ae962a6fd921973a3f.png and /dev/null differ diff --git a/docs/images/chapters/projections/53e3f490bddfb0c050a65c968eda51b8.png b/docs/images/chapters/projections/53e3f490bddfb0c050a65c968eda51b8.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/53e3f490bddfb0c050a65c968eda51b8.png and /dev/null differ diff --git a/docs/images/chapters/projections/56a7edb67bf4291d67cde34718be3cac.png b/docs/images/chapters/projections/56a7edb67bf4291d67cde34718be3cac.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/56a7edb67bf4291d67cde34718be3cac.png and /dev/null differ diff --git a/docs/images/chapters/projections/635221f696ed312d136ccb94c3997d7f.png b/docs/images/chapters/projections/635221f696ed312d136ccb94c3997d7f.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/635221f696ed312d136ccb94c3997d7f.png and /dev/null differ diff --git a/docs/images/chapters/projections/64df57ae017fcb2c7cab3c4c967edd1b.png b/docs/images/chapters/projections/64df57ae017fcb2c7cab3c4c967edd1b.png deleted file mode 100644 index d473bf64..00000000 Binary files a/docs/images/chapters/projections/64df57ae017fcb2c7cab3c4c967edd1b.png and /dev/null differ diff --git a/docs/images/chapters/projections/6884af1a5542fb85526e9bc0b45fe938.png b/docs/images/chapters/projections/6884af1a5542fb85526e9bc0b45fe938.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/6884af1a5542fb85526e9bc0b45fe938.png and /dev/null differ diff --git a/docs/images/chapters/projections/691812baa6b8bce97682867bab5f2136.png b/docs/images/chapters/projections/691812baa6b8bce97682867bab5f2136.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/691812baa6b8bce97682867bab5f2136.png and /dev/null differ diff --git a/docs/images/chapters/projections/6b48d7f6956d79d82569e94781949ca2.png b/docs/images/chapters/projections/6b48d7f6956d79d82569e94781949ca2.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/6b48d7f6956d79d82569e94781949ca2.png and /dev/null differ diff --git a/docs/images/chapters/projections/6bf3670076358e398775fb514648a7fd.png b/docs/images/chapters/projections/6bf3670076358e398775fb514648a7fd.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/6bf3670076358e398775fb514648a7fd.png and /dev/null differ diff --git a/docs/images/chapters/projections/6d7cca317b97cb69365ef16fefa1117d.png b/docs/images/chapters/projections/6d7cca317b97cb69365ef16fefa1117d.png deleted file mode 100644 index 1f910314..00000000 Binary files a/docs/images/chapters/projections/6d7cca317b97cb69365ef16fefa1117d.png and /dev/null differ diff --git a/docs/images/chapters/projections/751826197775209933b04be54c9617b2.png b/docs/images/chapters/projections/751826197775209933b04be54c9617b2.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/751826197775209933b04be54c9617b2.png and /dev/null differ diff --git a/docs/images/chapters/projections/76b1c706ef985244ce1e18cbc048bc44.png b/docs/images/chapters/projections/76b1c706ef985244ce1e18cbc048bc44.png deleted file mode 100644 index 1f910314..00000000 Binary files a/docs/images/chapters/projections/76b1c706ef985244ce1e18cbc048bc44.png and /dev/null differ diff --git a/docs/images/chapters/projections/78507c14166e6b50d89974c9d470a898.png b/docs/images/chapters/projections/78507c14166e6b50d89974c9d470a898.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/78507c14166e6b50d89974c9d470a898.png and /dev/null differ diff --git a/docs/images/chapters/projections/7fb013cb52bc50b1dbe3bd08e8999038.png b/docs/images/chapters/projections/7fb013cb52bc50b1dbe3bd08e8999038.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/7fb013cb52bc50b1dbe3bd08e8999038.png and /dev/null differ diff --git a/docs/images/chapters/projections/7fe65c1ebf12629e32a2ba5de5ebf8f5.png b/docs/images/chapters/projections/7fe65c1ebf12629e32a2ba5de5ebf8f5.png deleted file mode 100644 index 502788bd..00000000 Binary files a/docs/images/chapters/projections/7fe65c1ebf12629e32a2ba5de5ebf8f5.png and /dev/null differ diff --git a/docs/images/chapters/projections/806bd549ae8a1458012d0a9b6be4dafd.png b/docs/images/chapters/projections/806bd549ae8a1458012d0a9b6be4dafd.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/806bd549ae8a1458012d0a9b6be4dafd.png and /dev/null differ diff --git a/docs/images/chapters/projections/82a01d3a65c77e0dc987243436043cc9.png b/docs/images/chapters/projections/82a01d3a65c77e0dc987243436043cc9.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/82a01d3a65c77e0dc987243436043cc9.png and /dev/null differ diff --git a/docs/images/chapters/projections/845b914dd875fcc404e4e5ed4d67b63d.png b/docs/images/chapters/projections/845b914dd875fcc404e4e5ed4d67b63d.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/845b914dd875fcc404e4e5ed4d67b63d.png and /dev/null differ diff --git a/docs/images/chapters/projections/85e70f4f5ce1d5cd0a24cc4e54fda4e9.png b/docs/images/chapters/projections/85e70f4f5ce1d5cd0a24cc4e54fda4e9.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/85e70f4f5ce1d5cd0a24cc4e54fda4e9.png and /dev/null differ diff --git a/docs/images/chapters/projections/87455237e3ed450a87ba23d34938fd78.png b/docs/images/chapters/projections/87455237e3ed450a87ba23d34938fd78.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/87455237e3ed450a87ba23d34938fd78.png and /dev/null differ diff --git a/docs/images/chapters/projections/8c0eb658c745f6ba196ffdaf9882c137.png b/docs/images/chapters/projections/8c0eb658c745f6ba196ffdaf9882c137.png deleted file mode 100644 index d473bf64..00000000 Binary files a/docs/images/chapters/projections/8c0eb658c745f6ba196ffdaf9882c137.png and /dev/null differ diff --git a/docs/images/chapters/projections/8dd7749367b02d3e790bc83a810b7abb.png b/docs/images/chapters/projections/8dd7749367b02d3e790bc83a810b7abb.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/8dd7749367b02d3e790bc83a810b7abb.png and /dev/null differ diff --git a/docs/images/chapters/projections/930a8a3b3119d15f01a443e95d56675a.png b/docs/images/chapters/projections/930a8a3b3119d15f01a443e95d56675a.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/930a8a3b3119d15f01a443e95d56675a.png and /dev/null differ diff --git a/docs/images/chapters/projections/98dddd885ecf7d63cfed99af9ca5beb2.png b/docs/images/chapters/projections/98dddd885ecf7d63cfed99af9ca5beb2.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/98dddd885ecf7d63cfed99af9ca5beb2.png and /dev/null differ diff --git a/docs/images/chapters/projections/a07c63add1d26286382105f3f6b78e18.png b/docs/images/chapters/projections/a07c63add1d26286382105f3f6b78e18.png deleted file mode 100644 index ec9f1a20..00000000 Binary files a/docs/images/chapters/projections/a07c63add1d26286382105f3f6b78e18.png and /dev/null differ diff --git a/docs/images/chapters/projections/a270e4df231ba59d6076c549e73b8170.png b/docs/images/chapters/projections/a270e4df231ba59d6076c549e73b8170.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/a270e4df231ba59d6076c549e73b8170.png and /dev/null differ diff --git a/docs/images/chapters/projections/a4f979a9249f2d0e532a0ba7af931d89.png b/docs/images/chapters/projections/a4f979a9249f2d0e532a0ba7af931d89.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/a4f979a9249f2d0e532a0ba7af931d89.png and /dev/null differ diff --git a/docs/images/chapters/projections/ac8218ecf6fb2a5e8aa4657b7f687e43.png b/docs/images/chapters/projections/ac8218ecf6fb2a5e8aa4657b7f687e43.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/ac8218ecf6fb2a5e8aa4657b7f687e43.png and /dev/null differ diff --git a/docs/images/chapters/projections/ac89570a40940cce9c73546df111b03a.png b/docs/images/chapters/projections/ac89570a40940cce9c73546df111b03a.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/ac89570a40940cce9c73546df111b03a.png and /dev/null differ diff --git a/docs/images/chapters/projections/adf001b9315e91782329f3f3da65f707.png b/docs/images/chapters/projections/adf001b9315e91782329f3f3da65f707.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/adf001b9315e91782329f3f3da65f707.png and /dev/null differ diff --git a/docs/images/chapters/projections/b1df965acbf4a8b8129fb919de2b087e.png b/docs/images/chapters/projections/b1df965acbf4a8b8129fb919de2b087e.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/b1df965acbf4a8b8129fb919de2b087e.png and /dev/null differ diff --git a/docs/images/chapters/projections/bbbabe7a1e411fe798ca543cf3892837.png b/docs/images/chapters/projections/bbbabe7a1e411fe798ca543cf3892837.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/bbbabe7a1e411fe798ca543cf3892837.png and /dev/null differ diff --git a/docs/images/chapters/projections/bc0792b363fbbfe37dad5cf3f8b95be5.png b/docs/images/chapters/projections/bc0792b363fbbfe37dad5cf3f8b95be5.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/bc0792b363fbbfe37dad5cf3f8b95be5.png and /dev/null differ diff --git a/docs/images/chapters/projections/c0788614901af49764413ef3c9e18576.png b/docs/images/chapters/projections/c0788614901af49764413ef3c9e18576.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/c0788614901af49764413ef3c9e18576.png and /dev/null differ diff --git a/docs/images/chapters/projections/c1e332fa22fef563e7be445babe814be.png b/docs/images/chapters/projections/c1e332fa22fef563e7be445babe814be.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/c1e332fa22fef563e7be445babe814be.png and /dev/null differ diff --git a/docs/images/chapters/projections/c98e64908e086225b00f56cf2266e891.png b/docs/images/chapters/projections/c98e64908e086225b00f56cf2266e891.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/c98e64908e086225b00f56cf2266e891.png and /dev/null differ diff --git a/docs/images/chapters/projections/caba733bba6a10caa1d5a7a1f569d2e8.png b/docs/images/chapters/projections/caba733bba6a10caa1d5a7a1f569d2e8.png deleted file mode 100644 index 4e9fa26b..00000000 Binary files a/docs/images/chapters/projections/caba733bba6a10caa1d5a7a1f569d2e8.png and /dev/null differ diff --git a/docs/images/chapters/projections/ce606d42fbcb0456a22d164a69888e5f.png b/docs/images/chapters/projections/ce606d42fbcb0456a22d164a69888e5f.png deleted file mode 100644 index 1f910314..00000000 Binary files a/docs/images/chapters/projections/ce606d42fbcb0456a22d164a69888e5f.png and /dev/null differ diff --git a/docs/images/chapters/projections/d1901b47445925ea865e3d9b707c9777.png b/docs/images/chapters/projections/d1901b47445925ea865e3d9b707c9777.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/d1901b47445925ea865e3d9b707c9777.png and /dev/null differ diff --git a/docs/images/chapters/projections/da9d101cfee9d8ef860eaa5af3b3bd23.png b/docs/images/chapters/projections/da9d101cfee9d8ef860eaa5af3b3bd23.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/da9d101cfee9d8ef860eaa5af3b3bd23.png and /dev/null differ diff --git a/docs/images/chapters/projections/e0e513ec66ce1714ebeae98479886319.png b/docs/images/chapters/projections/e0e513ec66ce1714ebeae98479886319.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/e0e513ec66ce1714ebeae98479886319.png and /dev/null differ diff --git a/docs/images/chapters/projections/e5bd707ac5956d56252c5f6568f85721.png b/docs/images/chapters/projections/e5bd707ac5956d56252c5f6568f85721.png deleted file mode 100644 index 3d1d189a..00000000 Binary files a/docs/images/chapters/projections/e5bd707ac5956d56252c5f6568f85721.png and /dev/null differ diff --git a/docs/images/chapters/projections/e87beabbf798da7858359ae34d68ee39.png b/docs/images/chapters/projections/e87beabbf798da7858359ae34d68ee39.png deleted file mode 100644 index 1f910314..00000000 Binary files a/docs/images/chapters/projections/e87beabbf798da7858359ae34d68ee39.png and /dev/null differ diff --git a/docs/images/chapters/projections/f0623977b8fdcb4b51f1634c68435f45.png b/docs/images/chapters/projections/f0623977b8fdcb4b51f1634c68435f45.png deleted file mode 100644 index f59ce39d..00000000 Binary files a/docs/images/chapters/projections/f0623977b8fdcb4b51f1634c68435f45.png and /dev/null differ diff --git a/docs/images/chapters/projections/f75089713aa63ffa08c43352da3e3a08.png b/docs/images/chapters/projections/f75089713aa63ffa08c43352da3e3a08.png deleted file mode 100644 index ec9f1a20..00000000 Binary files a/docs/images/chapters/projections/f75089713aa63ffa08c43352da3e3a08.png and /dev/null differ diff --git a/docs/images/chapters/projections/fa8ba49c448cbd286de961e1d9c9b05f.png b/docs/images/chapters/projections/fa8ba49c448cbd286de961e1d9c9b05f.png deleted file mode 100644 index 1f910314..00000000 Binary files a/docs/images/chapters/projections/fa8ba49c448cbd286de961e1d9c9b05f.png and /dev/null differ diff --git a/docs/images/chapters/projections/fce5bf0de4adcfae80358f1b3ee08d5a.png b/docs/images/chapters/projections/fce5bf0de4adcfae80358f1b3ee08d5a.png deleted file mode 100644 index 71aa1186..00000000 Binary files a/docs/images/chapters/projections/fce5bf0de4adcfae80358f1b3ee08d5a.png and /dev/null differ diff --git a/docs/images/chapters/projections/ffd1a94295ab629a8718ed58f0a20369.png b/docs/images/chapters/projections/ffd1a94295ab629a8718ed58f0a20369.png deleted file mode 100644 index fd8acd3e..00000000 Binary files a/docs/images/chapters/projections/ffd1a94295ab629a8718ed58f0a20369.png and /dev/null differ diff --git a/docs/images/snippets/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.ascii b/docs/images/snippets/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.ascii new file mode 100644 index 00000000..7555f8c8 --- /dev/null +++ b/docs/images/snippets/circleintersection/3e0594855ca99fb87dcc65a693e1ad22.ascii @@ -0,0 +1,11 @@ +\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math + + r= dist(B(t), c) + ┌─────────────────────────┐ + │ 2 2 + = │(B t - c ) + (B t - c ) + ⟍│ x x y y + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │╭ 3 2 2 3 ╮2 ╭ 3 2 2 3 ╮2 + = ││ x (1-t) + 3 x (1-t) t + 2 x (1-t) t + x t - c │ + │ y (1-t) + 3 y (1-t) t + 2 y (1-t) t + y t - c │ + ⟍│╰ 1 2 3 4 x ╯ ╰ 1 2 3 4 y ╯ diff --git a/docs/index.html b/docs/index.html index d516045e..fa24d6eb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -38,7 +38,7 @@ - + @@ -6299,14 +6299,15 @@ lli = function(line1, line2): - @@ -6329,6 +6330,9 @@ for (coordinate, index) in LUT: + + +
1 -
7
8

@@ -6400,21 +6404,21 @@ for (coordinate, index) in LUT:

@@ -6437,7 +6441,7 @@ for (coordinate, index) in LUT: 1 @@ -6527,9 +6533,6 @@ run: 10 - - 11 -

@@ -6544,24 +6547,23 @@ run: - @@ -6469,6 +6470,9 @@ for (coordinate, index) in LUT: + + +
1 -
7
8

@@ -6547,21 +6551,21 @@ for (coordinate, index) in LUT:

@@ -6584,7 +6588,7 @@ for (coordinate, index) in LUT: 1 @@ -6674,9 +6680,6 @@ run: 10 - - 11 -

@@ -6691,24 +6694,23 @@ run: - @@ -6604,6 +6605,9 @@ for (coordinate, index) in LUT: + + +
1 -
7
8

@@ -6682,21 +6686,21 @@ for (coordinate, index) in LUT:

@@ -6719,7 +6723,7 @@ for (coordinate, index) in LUT: 1 @@ -6809,9 +6815,6 @@ run: 10 - - 11 -

@@ -6826,24 +6829,23 @@ run: - @@ -6445,6 +6446,9 @@ for (coordinate, index) in LUT: + + +
1 -
7
8

@@ -6523,21 +6527,21 @@ for (coordinate, index) in LUT:

@@ -6560,7 +6564,7 @@ for (coordinate, index) in LUT: 1 @@ -6650,9 +6656,6 @@ run: 10 - - 11 -

@@ -6667,24 +6670,23 @@ run: -
1 -