1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-18 22:41:49 +02:00

some fixes

This commit is contained in:
Pomax
2021-01-10 13:17:36 -08:00
parent 39d0148269
commit 403f7f0595
33 changed files with 382 additions and 294 deletions

View File

@@ -25,7 +25,7 @@ jobs:
- name: Installing TeX Live - name: Installing TeX Live
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install xzdec libpoppler-glib-dev texlive texlive-xetex texlive-extra-utils -y sudo apt-get install xzdec libpoppler-glib-dev texlive texlive-xetex texlive-fonts-extra texlive-math-extra texlive-extra-utils -y
- name: Installing pdf2svg - name: Installing pdf2svg
run: | run: |

View File

@@ -25,7 +25,7 @@ jobs:
- name: Installing TeX Live - name: Installing TeX Live
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install xzdec libpoppler-glib-dev texlive texlive-xetex texlive-extra-utils -y sudo apt-get install xzdec libpoppler-glib-dev texlive texlive-xetex texlive-fonts-extra texlive-math-extra texlive-extra-utils -y
- name: Installing pdf2svg - name: Installing pdf2svg
run: | run: |

View File

@@ -19,7 +19,7 @@
\end{matrix} \end{matrix}
\] \]
Итак, нам представлены две функции. Ничего особо выдающегося: просто функции синуса и косинуса. Отметим, что, как вы можете видеть, вводные переменные разные. Затем, меняя значение <i>a</i>, мы не влияем на вывод <i>f(b)</i>, поскольку <i>a</i> никак не задействована в этой функции. Параметрические функции хитрят именно с этим: весь набор функций вывода делит между собой одну или более переменную вводную. Как здесь: Итак, нам представлены две функции. Ничего особо выдающегося: просто функции синуса и косинуса. Отметим, что, как вы можете видеть, вводные переменные разные. Затем, меняя значение <i>a</i>, мы не влияем на вывод <i>f(b)</i>, поскольку <i>a</i> никак не задействована в этой функции. Параметрические функции хитрят именно с этим: весь набор функций вывода делит между собой одну или более переменную вводную. Как здесь:
\[ \[
\left \{ \begin{matrix} \left \{ \begin{matrix}
@@ -28,7 +28,7 @@
\end{matrix} \right. \end{matrix} \right.
\] \]
Что же, несколько функций, и всего одна вводная. Меняя значение <i>t</i> — меняем вывод обеих ф-ций, <i>f<sub>a</sub>(t)</i> и <i>f<sub>b</sub>(t)</i>. Возможно вы спросите: "в чем же польза?". Ответ прост и очевиден, если уточнить, что мы имеем ввиду под записью наших функций: Что же, несколько функций, и всего одна вводная. Меняя значение <i>t</i> — меняем вывод обеих ф-ций, <i>f<sub>a</sub>(t)</i> и <i>f<sub>b</sub>(t)</i>. Возможно вы спросите: "в чем же польза?". Ответ прост и очевиден, если уточнить, что мы имеем ввиду под записью наших функций:
\[ \[
\left \{ \begin{matrix} \left \{ \begin{matrix}
@@ -45,7 +45,7 @@
<input type="range" min="0" max="10" step="0.1" value="5" class="slide-control"> <input type="range" min="0" max="10" step="0.1" value="5" class="slide-control">
</graphics-element> </graphics-element>
Кривые Безье — всего один из многих классов параметрических функций. Их главной характеристикой есть использование одной и той же базовой функции для генерации всех выводов. До сих пор, в использованном нами примере, мы производили значения <i>x</i> и <i>y</i> с помощью разных функций (ф-цией синуса и ф-цией косинуса); Безье же использует единый "биноминальный полином" для вывода обоих значений. Но что же такое "биноминальный полином"? Кривые Безье — всего один из многих классов параметрических функций. Их главной характеристикой есть использование одной и той же базовой функции для генерации всех выводов. До сих пор, в использованном нами примере, мы производили значения <i>x</i> и <i>y</i> с помощью разных функций (ф-цией синуса и ф-цией косинуса); Безье же использует единый "биноминальный полином" для вывода обоих значений. Но что же такое "биноминальный полином"?
Возможно, вы помните полиномы из школьной программы. Они выглядят следующим образом: Возможно, вы помните полиномы из школьной программы. Они выглядят следующим образом:
@@ -138,8 +138,7 @@ function binomial(n,k):
return lut[n][k] return lut[n][k]
``` ```
Итак, что же здесь происходит? Сначала мы декларируем таблицу достаточного размера для удовлетворения большинства запросов. Далее мы заявляем функцию вывода необходимого значения, вытаскивая его из таблицы, предварительно убедившись, что значения для запрашиваемых <i>n/k</i> присутствуют в наборе и расширяя набор по необходимости (если не присутствуют). Наша базовая функция теперь выглядит типа этого: Итак, что же здесь происходит? Сначала мы декларируем таблицу достаточного размера для удовлетворения большинства запросов. Далее мы заявляем функцию вывода необходимого значения, вытаскивая его из таблицы, предварительно убедившись, что значения для запрашиваемых <i>n/k</i> присутствуют в наборе и расширяя набор по необходимости (если не присутствуют). Наша базовая функция теперь выглядит типа этого:
``` ```
function Bezier(n,t): function Bezier(n,t):
@@ -147,11 +146,10 @@ function Bezier(n,t):
for(k=0; k<=n; k++): for(k=0; k<=n; k++):
sum += binomial(n,k) * (1-t)^(n-k) * t^(k) sum += binomial(n,k) * (1-t)^(n-k) * t^(k)
return sum return sum
``` ```
Отлично. Конечно, мы можем оптимизировать ее и далее. Для большинства задач компьютерной графики нам не потребуются кривые произвольного порядка (хотя мы приводим код для произвольных кривых в этом пособии); зачастую нам нужны квадратные и кубические кривые, а это значит, мы можем значительно упростить весь наш код: Отлично. Конечно, мы можем оптимизировать ее и далее. Для большинства задач компьютерной графики нам не потребуются кривые произвольного порядка (хотя мы приводим код для произвольных кривых в этом пособии); зачастую нам нужны квадратные и кубические кривые, а это значит, мы можем значительно упростить весь наш код:
``` ```
function Bezier(2,t): function Bezier(2,t):
t2 = t * t t2 = t * t
@@ -172,4 +170,4 @@ function Bezier(3,t):
</div> </div>
Итак, зная как выглядят базовые функции, время добавить магию делающую кривые Безье такими особенными: контрольные точки. Итак, зная как выглядят базовые функции, время добавить магию делающую кривые Безье такими особенными: контрольные точки.

View File

@@ -6,7 +6,7 @@
\[ \[
Bézier(n,t) = \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot w_i Bézier(n,t) = \sum_{i=0}^{n} \binom{n}{i} \cdot (1-t)^{n-i} \cdot t^{i} \cdot w_i
\] \]
Функция для соотносительных кривых Безье имеет два дополнительных термина: Функция для соотносительных кривых Безье имеет два дополнительных термина:
@@ -29,15 +29,14 @@
<input type="range" min="0.01" max="2" value="1" step="0.01" class="ratio-4"> <input type="range" min="0.01" max="2" value="1" step="0.01" class="ratio-4">
</graphics-element> </graphics-element>
Вы можете думать о значениях соотношений, как о показателе силы притяжения соответствующей точки. Чем выше сила притяжения, тем больше наша кривая будет стремится к этой точке. Вы также можете наблюдать, что одинаковое увеличение или уменьшение всех показателей не оказывает никакого эффекта на результат... схоже с гравитацией: если значения остаются одинаковыми относительно друг-друга, на выводе ничего не меняется. Значения соотношений определяют влияние каждой координаты _относительно всех остальных координат_. Вы можете думать о значениях соотношений, как о показателе силы притяжения соответствующей точки. Чем выше сила притяжения, тем больше наша кривая будет стремится к этой точке. Вы также можете наблюдать, что одинаковое увеличение или уменьшение всех показателей не оказывает никакого эффекта на результат... схоже с гравитацией: если значения остаются одинаковыми относительно друг-друга, на выводе ничего не меняется. Значения соотношений определяют влияние каждой координаты _относительно всех остальных координат_.
<div class="howtocode"> <div class="howtocode">
### Имплементация соотносительных кривых ### Имплементация соотносительных кривых
Дополнение кода из предыдущей секции для учета этой функциональности фактически тривиально: Дополнение кода из предыдущей секции для учета этой функциональности фактически тривиально:
``` ```
function RationalBezier(2,t,w[],r[]): function RationalBezier(2,t,w[],r[]):
t2 = t * t t2 = t * t

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,7 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
__ n n-i i
Bézier(n,t) = \undersetбиноминальный термин\underbrace\binomni · \ \undersetполиноминальный термин\underbrace(1-t) · t · \
‾‾ i=0
\undersetвес\underbracew
i

View File

@@ -0,0 +1,7 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
__ n n-i i
Bézier(n,t) = \undersetбиноминальный термин\underbrace\binomni · \ \undersetполиноминальный термин\underbrace(1-t) · t · \
‾‾ i=0
\undersetвес\underbracew
i

View File

@@ -0,0 +1,7 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
__ k k-i i
Bézier'(n,t) = \undersetбиноминальный термин\underbrace\binomki · \ \undersetполиноминальный термин\underbrace(1-t) · t · \
‾‾ i=0
\undersetвес производной\underbracen · (w - w ) , with k=n-1
i+1 i

View File

@@ -0,0 +1,7 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
╭ x! y x-y x! k x-k ╮
... = n │ ──────── t (1-t) - ──────── t (1-t) │ , где x=n-1, y=k-1
╰ y!(x-y)! k!(x-k)! ╯
... = n (B (t) - B (t))
(n-1),(k-1) (n-1),k

View File

@@ -0,0 +1,5 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
d __ n-1 __ n-1
Bézier (t) ── = n · B (t) · (w - w ) = B (t) · \undersetвес производной \underbracen · (w - w )
n,k dt ‾‾ k=0 n-1,k k+1 k ‾‾ k=0 n-1,k k+1 k

View File

@@ -0,0 +1,8 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
линийный= \colorbluea + \colorredb
квадратый= \colorbluea · \colorbluea + \colorbluea · \colorredb + \colorredb · \colorredb
кубический= \colorbluea · \colorbluea · \colorbluea + \colorbluea · \colorbluea · \colorredb + \colorbluea · \colorredb · \colorredb + \colorred
b · \colorredb · \colorredb

View File

@@ -0,0 +1,6 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
линийный= 1 + 1
квадратый= 1 + 2 + 1
кубический= 1 + 3 + 3 + 1
квартический= 1 + 4 + 6 + 4 + 1

View File

@@ -0,0 +1,7 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
линейный= (1-t) + t
2 2
квадратный= (1-t) + 2 · (1-t) · t + t
3 2 2 3
кубический= (1-t) + 3 · (1-t) · t + 3 · (1-t) · t + t

View File

@@ -0,0 +1,5 @@
\setmainfont[Ligatures=TeX]TeX Gyre Pagella \setmathfontTeX Gyre Pagella Math
__ n n-i i
Bézier(n,t) = \undersetбиноминальный термин\underbrace\binomni · \ \undersetполиноминальный термин\underbrace(1-t) · t
‾‾ i=0

View File

@@ -38,7 +38,7 @@
<meta property="og:locale" content="en-GB" /> <meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" /> <meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-12-25T20:05:36+00:00" /> <meta property="og:updated_time" content="2021-01-10T21:12:37+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />
@@ -134,7 +134,7 @@
<li><a href="./index.html">English</a> &nbsp;</li> <li><a href="./index.html">English</a> &nbsp;</li>
<li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li> <li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li>
<li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li> <li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li>
<li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(4%)</span></li> <li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(15%)</span></li>
<li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li> <li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li>
</ul> </ul>
<p> <p>

View File

@@ -41,7 +41,7 @@
<meta property="og:locale" content="ja-JP" /> <meta property="og:locale" content="ja-JP" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" /> <meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-12-25T20:05:36+00:00" /> <meta property="og:updated_time" content="2021-01-10T21:12:37+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />
@@ -137,7 +137,7 @@
<li><a href="./index.html">English</a> &nbsp;</li> <li><a href="./index.html">English</a> &nbsp;</li>
<li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li> <li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li>
<li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li> <li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li>
<li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(4%)</span></li> <li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(15%)</span></li>
<li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li> <li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li>
</ul> </ul>
<p> <p>

View File

@@ -33,8 +33,8 @@
<meta property="og:description" content="Rewriting the tech stack" /> <meta property="og:description" content="Rewriting the tech stack" />
<meta property="og:locale" content="en-GB" /> <meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="Fri Sep 18 2020 00:00:00 +00:00" /> <meta property="og:published_time" content="Thu Sep 17 2020 17:00:00 +00:00" />
<meta property="og:updated_time" content="Fri Dec 25 2020 20:05:37 +00:00" /> <meta property="og:updated_time" content="Sun Jan 10 2021 13:12:37 +00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />

View File

@@ -33,8 +33,8 @@
<meta property="og:description" content="Curve-circle intersections" /> <meta property="og:description" content="Curve-circle intersections" />
<meta property="og:locale" content="en-GB" /> <meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="Sun Nov 22 2020 00:00:00 +00:00" /> <meta property="og:published_time" content="Sat Nov 21 2020 16:00:00 +00:00" />
<meta property="og:updated_time" content="Fri Dec 25 2020 20:05:37 +00:00" /> <meta property="og:updated_time" content="Sun Jan 10 2021 13:12:37 +00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />

View File

@@ -33,7 +33,7 @@
<meta property="og:description" content="" /> <meta property="og:description" content="" />
<meta property="og:locale" content="en-GB" /> <meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="Fri Dec 25 2020 20:05:37 GMT+0000 (Coordinated Universal Time)" /> <meta property="og:published_time" content="Sun Jan 10 2021 13:12:37 GMT-0800 (Pacific Standard Time)" />
<meta property="og:updated_time" content="" /> <meta property="og:updated_time" content="" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />

View File

@@ -6,7 +6,7 @@
<atom:link href="https://pomax.github.io/bezierinfo" rel="self"></atom:link> <atom:link href="https://pomax.github.io/bezierinfo" rel="self"></atom:link>
<description>News updates for the <a href="https://pomax.github.io/bezierinfo">primer on Bézier Curves</a> by Pomax</description> <description>News updates for the <a href="https://pomax.github.io/bezierinfo">primer on Bézier Curves</a> by Pomax</description>
<language>en-GB</language> <language>en-GB</language>
<lastBuildDate>Fri Dec 25 2020 20:05:37 +00:00</lastBuildDate> <lastBuildDate>Sun Jan 10 2021 13:12:37 +00:00</lastBuildDate>
<image> <image>
<url>https://pomax.github.io/bezierinfo/images/og-image.png</url> <url>https://pomax.github.io/bezierinfo/images/og-image.png</url>
<title>A Primer on Bézier Curves</title> <title>A Primer on Bézier Curves</title>
@@ -23,7 +23,7 @@
&lt;p&gt;&lt;a href=&quot;https://twitter.com/TheRealPomax&quot;&gt;Pomax&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://twitter.com/TheRealPomax&quot;&gt;Pomax&lt;/a&gt;&lt;/p&gt;
</description> </description>
<pubDate>Sun Nov 22 2020 00:00:00 +00:00</pubDate> <pubDate>Sat Nov 21 2020 16:00:00 +00:00</pubDate>
<guid>2020-11-22.html</guid> <guid>2020-11-22.html</guid>
</item><item> </item><item>
<title>Rewriting the tech stack</title> <title>Rewriting the tech stack</title>
@@ -119,7 +119,7 @@ draw() {
&lt;p&gt;&lt;a href=&quot;https://twitter.com/TheRealPomax&quot;&gt;Pomax&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://twitter.com/TheRealPomax&quot;&gt;Pomax&lt;/a&gt;&lt;/p&gt;
</description> </description>
<pubDate>Fri Sep 18 2020 00:00:00 +00:00</pubDate> <pubDate>Thu Sep 17 2020 17:00:00 +00:00</pubDate>
<guid>2020-09-18.html</guid> <guid>2020-09-18.html</guid>
</item> </item>
</channel> </channel>

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,7 @@
<meta property="og:locale" content="uk-UA" /> <meta property="og:locale" content="uk-UA" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" /> <meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-12-25T20:05:36+00:00" /> <meta property="og:updated_time" content="2021-01-10T21:12:37+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />
@@ -132,7 +132,7 @@
<li><a href="./index.html">English</a> &nbsp;</li> <li><a href="./index.html">English</a> &nbsp;</li>
<li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li> <li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li>
<li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li> <li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li>
<li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(4%)</span></li> <li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(15%)</span></li>
<li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li> <li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li>
</ul> </ul>
<p> <p>

View File

@@ -41,7 +41,7 @@
<meta property="og:locale" content="zh-CN" /> <meta property="og:locale" content="zh-CN" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" /> <meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-12-25T20:05:36+00:00" /> <meta property="og:updated_time" content="2021-01-10T21:12:37+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" /> <meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" /> <meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" /> <meta property="og:tag" content="Bézier Curves" />
@@ -137,7 +137,7 @@
<li><a href="./index.html">English</a> &nbsp;</li> <li><a href="./index.html">English</a> &nbsp;</li>
<li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li> <li><a href="./ja-JP/index.html">日本語</a> <span class="localisation-progress">(24%)</span></li>
<li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li> <li><a href="./zh-CN/index.html">中文</a> <span class="localisation-progress">(22%)</span></li>
<li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(4%)</span></li> <li><a href="./ru-RU/index.html">Русский</a> <span class="localisation-progress">(15%)</span></li>
<li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li> <li><a href="./uk-UA/index.html">Українська</a> <span class="localisation-progress">(2%)</span></li>
</ul> </ul>
<p> <p>

View File

@@ -54,6 +54,15 @@ export default async function latexToSVG(latex, pathdata, localeStrings, block)
\\setmathfont{TeX Gyre Pagella Math} \\setmathfont{TeX Gyre Pagella Math}
`; `;
if (locale === "ru-RU" || locale === "zh-CN") {
fonts = `
\\usepackage{unicode-math}
\\setmainfont[Ligatures=TeX]{Linux Libertine O}
\\\setmathfont{XITS Math}
`;
// For some reason https://tex.stackexchange.com/a/201244/8406 yields xetex errors...
}
// For Chinese, we need the xeCJK package because there might be Chinese // For Chinese, we need the xeCJK package because there might be Chinese
// in maths context, which base XeLaTeX can't quite deal with. // in maths context, which base XeLaTeX can't quite deal with.
if (locale === "zh-CN") { if (locale === "zh-CN") {