Sekai ๐ŸŒ ๐Ÿ—บ

Sekai (ไธ–็•Œ) is the kanji for “the world”. That’s a great word because of the scale that it designates.

Dvisvgm's Issue With Fill Pattern

Goal Generate SVG file for TikZ graphics. Method TeX โ†’ PDF with PDFLaTeX PDF โ†’ SVG with dvisvgm -P filename Example: I generated a PGF plot from the source code on my personal template. Problem When I applied this method to the following TeX code in my previous post, dvisvgm -P returns a blank SVG. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=center,legend style={at={(0.7,0.7)},anchor=south west}] \addplot [domain=-3:3, thick, smooth, yellow] { 1/sqrt(2*pi)*exp(-x^2/2) }; \addlegendentry{$y = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}$}; \addplot [dashed, yellow] coordinates {(1. [Read More]
LaTeX  dvisvgm  SVG 

To Be Improved Normal Curve

First function plot with pattern fill

Adaptations for standalone documents:

  • \usetikzlibrary{pattern} before \begin{document}
  • \pgfplotsset{compat=1.6}
\begin{tikzpicture}
\begin{axis} [axis lines=center,legend style={at={(0.7,0.7)},anchor=south west}]
\addplot [domain=-3:3, thick, smooth, yellow] { 1/sqrt(2*pi)*exp(-x^2/2) };
\addlegendentry{$y = \tfrac{1}{\sqrt{2\pi}} e^{-x^2/2}$};
\addplot [dashed, yellow] coordinates {(1.5,0) (1.5,0.14)};
\addlegendentry{99th percentile};
\addplot[domain=-3:1.5, pattern=north east lines,draw=none, fill opacity=0.3]
{ 1/sqrt(2*pi)*exp(-x^2/2) } \closedcycle;
\end{axis}
\end{tikzpicture}

tikz function shaded region

LaTeX 

Trigonometric Functions by Unit Circle

For secondary school students, I define cosine and sine as the x and y-components of the point A (cos ฮธ, sin ฮธ) on the unit circle xยฒ + yยฒ = 1, and the tangent function as the quotient of sine over cosine. \begin{tikzpicture}[scale=3] \coordinate (O) at (0,0); \coordinate (H) at (0.6,0); \coordinate (A) at (0.6,0.8); \coordinate (E) at (1,0); \coordinate (T) at (1,0.8/0.6); \draw (O) circle (1); \draw[->] (-1.3,0) -- (1. [Read More]
LaTeX 

Matrix Diagonalisation and Change of Basis

Here’s the $\LaTeX$ code of my diagram for matrix diagonalisation to be used on Discord. Why do matrix diagonalisation on square matrix $P$? If we can find a diagonal matrix $D$ and a square matrix $Q$ such that $P = QDQ^{-1}$, then we can easily compute $(P + \lambda I)^n$ for any scalar $\lambda$ and integer $n$ because $D^n$ is easy to compute. \[\begin{tikzcd} {{}} & {{}} & \cdots & {} \\ {{}} & {{}} & \cdots & {{}} \arrow["P", from=1-1, to=1-2] \arrow["{Q^{-1}}"', from=1-1, to=2-1] \arrow["D"', from=2-1, to=2-2] \arrow["Q"', from=2-2, to=1-2] \arrow["P", from=1-2, to=1-3] \arrow["D"', from=2-2, to=2-3] \arrow["P", from=1-3, to=1-4] \arrow["D"', from=2-3, to=2-4] \arrow["Q"', from=2-4, to=1-4] \end{tikzcd}\] After viewing the power of the Discord bot $\TeX{}$it, which renders $\LaTeX$ code on Discord, I gave up spending more time on exploring more functionalities of $\KaTeX$ (say, commutative diagrams) because Discord and $\LaTeX$ spread math knowledge much better than a static blog for basic math: the former allows instant feedback from the reader. [Read More]
LaTeX 

LaTeX Code for Linear System

\begin{align} A\mathbf{x} &= \mathbf{b} \\ \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} &= \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} \\ \begin{bmatrix} \vert & \vert & \vert \\ \mathbf{a}_1 & \mathbf{a}_2 & \mathbf{a}_3 \\ \vert & \vert & \vert \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} &= \mathbf{b} \\ x_1 \mathbf{a}_1 + x_2 \mathbf{a}_2 + x_3 \mathbf{a}_3 &= \mathbf{b} \tag{$\star$} \\ \begin{pmatrix} a_{11} x_1 + a_{12} x_2 + a_{13} x_3 \\ a_{21} x_1 + a_{22} x_2 + a_{23} x_3 \\ a_{31} x_1 + a_{32} x_2 + a_{33} x_3 \end{pmatrix} &= \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} \\ x_1 \begin{pmatrix} a_{11} \\ a_{21} \\ a_{31} \end{pmatrix} + x_2 \begin{pmatrix} a_{12} \\ a_{22} \\ a_{32} \end{pmatrix} + x_3 \begin{pmatrix} a_{13} \\ a_{32} \\ a_{33} \end{pmatrix} &= \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} \end{align} Source code: [Read More]
LaTeX 

Polar Rose in Julia

Background I’m doing exercise 4.9 of Think Julia, which asks for a function for a polar rose using Luxor’s turtle graphics. Difficulties Work out the geometric structure of the family of polar roses. The key is to construct some auxiliary isoceles triangles and work out the angles between them. One sees that they are parametrized by two varaibles n and k. n: number of petals k: petal increment constraint: k โ‰  n รท 2 Handle the case when gcd(n, k) > 1, i. [Read More]

Deploy Hugo Theme exampleSite With Github Actions

Motivation To test PRs on the upstream of a Hugo theme by setting up a testing branch. Goal To deploy a forked GitHub repo for a Hugo theme with exampleSite to GitHub Pages using GitHub Actions. The whole article is based on my fork of Hugo Future Imperfect Slim. References GitHub Actions for Hugo A Stack Overflow question showing pwd in GitHub Actions A Hugo Discourse post about testing exampleSite Difficulties I had failed for about ten times before I got the job done. [Read More]

First Experience with ASP.NET Core MVC & PostgreSQL

Goal To build an ASP.NET Core 5 MVC web app linked with a PostgreSQL. Motivation SQL Server is proprietary. SQLite used in Microsoft’s ASP.NET Core 5 MVC tutorial isn’t made for web apps. MySQL doesn’t perform well with concurrent read-writes. It’s dual-licensed like GitLab. Some users find PostgreSQL cost-effective. Useful tutorials MS’s tutorial in item 2 above. Wes Doyle’s YouTube video goes through the steps MS’s tutorial for Razor Pages with EF Core migrations Steps Create a superuser in the database. [Read More]

Deleted Question on Semi-Simple and Projective but not Injective Module

A backup of a deleted PSQ : https://math.stackexchange.com/q/3955443/290189 OP : irfanmat It has a detailed answer by Atticus Stonestrom. It’s pity that his post got deleted. As there’s no reason for undeletion, I’m posting it here so as to preserve the contents. Question body Is there a semi-simple and projective but not injective module? I will be glad if you help. Response(s) In the non-commutative case, the answer is yes. Consider $R$ the ring of upper triangular $2\times 2$ matrices over a field $F$, and denote by $e_{ij}$ the element of $R$ with the $ij$-th entry equal to $1$ and all other entries equal to $0$. [Read More]

Another Math.SE Double Integral Using Polar Coordinate

I wanted to post the following answer to a question on double integral on Math.SE, but someone had submitted his work before I finished typing. As a result, I’m posting this on my personal blog. Let $r = \sqrt{x^2+4y^2}$ and $t = \begin{cases} \tan^{-1}(2y/x) &\text{ if } x > 0 \\ \pi/2 &\text{ if } x = 0. \end{cases}$ Then $\begin{cases} x &= r \cos t \\ y &= (r \sin t)/2 \end{cases}$ and $D = { (r,t) \mid r \ge 0, t \in [\pi/4, \pi/2] }$. [Read More]