@@ -122,7 +122,7 @@ Meanwhile, the interval is always proportional to the radius.
122122
123123You might be confused by the statement "always proportional to the radius."
124124Though it's intuitively correct as the animation below shows.
125- I'll soon explain it with precise mathematical formulas , so don't worry about it too much for now.
125+ I'll soon explain it mathematically , so don't worry about it too much for now.
126126
127127![ interval animation] ( ./interval-ratio-animation.gif )
128128<figcaption >
193193\tag{1} n(x) = -\frac{1}{\eta \cos\theta} \ln(r_0 - \cos\theta x) \bigg|_0^x = -\frac{1}{\eta \cos\theta} \ln (1 - \frac{\cos\theta x}{r_0})
194194$$
195195
196- Exchange the dependent and independent variable in formula (1) and get:
196+ Exchange the dependent and independent variable in equation (1) and get:
197197
198198$$
199199\tag{2} x(n) = \frac{r_0}{\cos\theta}(1 - e^{-\eta\cos\theta n})
205205\tag{3} n_L = \frac{L}{\eta (r_0-r_1)}\ln \frac{r_0}{r_1}
206206$$
207207
208- We will soon use the formula (1)(2)(3) in our code.
208+ We will soon use the equation (1)(2)(3) in our code.
209209
210210How do we place footprints?
211211Imagine a point starts from the first vertex and moves along the polyline.
@@ -220,7 +220,7 @@ Label the two roots with $x_1$ and $x_2$.
220220
221221To calculate the nearest stamp point (the black dot in the figure) between $x_1$ and $x_2$,
222222we need to compute the number of stamps from $x_1$ to the polyline's first vertex, which is also called stamp index (or stamp count) at $x_1$.
223- According to formula (1), on the current edge, the number of stamps from vertex0 to $x_1$ is $n(x_1)$.
223+ According to equation (1), on the current edge, the number of stamps from vertex0 to $x_1$ is $n(x_1)$.
224224Label the stamp index of vertex0 as $n_ { s_0 } $, and label vertex1's as $n_ { s_1 } $.
225225(The symbol $s$ represents the arc from the first to current vertex).
226226
@@ -230,10 +230,10 @@ Therefore, the stamp index of $x_1$ is $n_{s_0} + n(x_1)$.
230230Because we place footprints at the points with integer stamp index,
231231the ceiling of $n_ { s_0 } + n(x_1)$ is the nearest stamp's index,
232232denoted as $n_ \mathrm{ nearest } = \lceil n_ { s_0 } + n(x_1) \rceil$.
233- Replace it into the formula (2) to get its position $x_ { \mathrm {nearest }} = x(\lceil n_ { s_0 } + n(x_1) \rceil)$,
233+ Replace it into the equation (2) to get its position $x_ { \mathrm {nearest }} = x(\lceil n_ { s_0 } + n(x_1) \rceil)$,
234234and all other positions $x(n_ \mathrm{ nearest } + 1)$, $x(n_ \mathrm{ nearest } + 2) \dots$
235235
236- Additionally, to determine $n_ { s_0 } $ and $n_ { s_1 } $, we can compute the prefix sum of the $n_L$ in formula (3) over all edges.
236+ Additionally, to determine $n_ { s_0 } $ and $n_ { s_1 } $, we can compute the prefix sum of the $n_L$ in equation (3) over all edges.
237237Put them into vertex data and pass them into fragment shader, exactly same as the value ` length ` in the Stamp section.
238238
239239## Implementation
@@ -245,7 +245,7 @@ import Stroke from "./ProportionalStampStroke";
245245
246246** Zero division:**
247247It's common for a stroke to have zero radii at their starting or ending vertices.
248- When either $r_0$ or $r_1$ is zero, the value in formula (3) can approach infinity.
248+ When either $r_0$ or $r_1$ is zero, the value in equation (3) can approach infinity.
249249This will bring numeric errors, which we surely want to avoid.
250250A simple solution is to add a small number to the radii, as demoed in the code above.
251251For a more rigorous approach, you can implement checks to prevent $r_0/r_1$ in the logarithm from becoming zero or excessively large.
277277$$
278278
279279** Proof:**
280- Substitute formula (3) into $r(x) = r_0 - \cos\theta x$ to obtain $r(n) = r_0e^{ - \eta \cos \theta n } $.
280+ Substitute equation (3) into $r(x) = r_0 - \cos\theta x$ to obtain $r(n) = r_0e^{ - \eta \cos \theta n } $.
281281The remainder of proof is straightforward.
282282
283283Note that these ratios are independent of $n$ or $x$,
@@ -320,7 +320,7 @@ This suggests that at any point in a given edge, the number of stamps that can c
320320If we connect the points with the same $\lambda$, they form an isocolor line.
321321
322322** Proof:**
323- With the formula (1), we can derive:
323+ With the equation (1), we can derive:
324324
325325$$
326326n(x_2) - n(x_1) = \frac{1}{\eta \cos\theta}\ln \frac{r(x_1)}{r(x_2)}
@@ -376,5 +376,5 @@ If you are interested in more details about the solving process, check the drop-
376376
377377 You verify the result after substituting $a, b, c$.
378378 Note that when $\lambda = 0$ or $\lambda = 1$, the $\triangle PQX_ { 1 } $ and $\triangle PQX_ { 2 } $ don't exist,
379- but the formula still works.
379+ but the equations still works.
380380</details >
0 commit comments