In "making" things, be it cool graphics, simulations, or tangible objects, mathematical concepts often play crucial roles. However, when you encounter topics like differentiation, integration, and diffusion, they might seem daunting, bringing back memories of complex equations and rigorous proofs. Seriously, when I see those formulas on the Wikipedia pages, they are just overwhelming.

グラフィックスやシミュレーション、物理的なオブジェクトなど、何かしらものを作る際には、数学の概念がよく重要になります。しかし微分、積分、拡散などの話題に出くわすと、複雑な方程式や厳密な証明を思い出して怯んでしまうこともあるでしょう。実際、Wikipediaのページでそれらの数式を見ると、圧倒されてしまいます。

The goal here is to introduce them from a different angle than ordinary math books. Especially for the purpose of creating things on a computer, you don't necessarily need to dive deep into their theoretical intricacies. More often than not, numerical methods, usually just combinations of basic additions and loops come to our rescue, providing good enough approximation and simplifying representation of these concepts.

ここでは、通常の数学の教科書とは異なる視点からこれらの概念を紹介しようと思います。特にコンピュータを使ってものを作るためには、必ずしも複雑な理論に深入りする必要はありません。ほとんどの場合、基本的な足し算とループの組み合わせだけで、これらの概念を十分な精度でシンプルに表現できます。

In these articles, we will discuss summation, differentiation, integration, and diffusion, trying to demystify these concepts with demos and examples. We will prioritize using the concepts to create something, rather than on their rigor, so that if you come across them, you can translate them into simple code that works.

下の記事では、総和、微分、積分、拡散についてデモや例を使ってこれらの概念を説明します。厳密さよりも、これらの概念を見かけた時にシンプルでちゃんと動くコードに変換できることを優先します。

Summation

総和

The summation represented by Sigma ($\sum$) is essentially a repetition of addition. It is commonly expressed using a simple loop in code. Summation is highly useful for approximating integrals, as we will discuss later, and for other concepts like Fourier series.

シグマ ($∑$) で表される総和は要は足し算の繰り返しで、コードでは大抵単純なループを使って表現できます。総和は下で取り上げる積分や、他にもフーリエ級数などを近似する時に活躍します。

Summation 総和

Differentiation

微分

Differentiation is a very important concept in dealing with motion, shape, and simulating physics. It is about finding the rate of change and the slope of a graph for a given function. When handling differentiation on a computer, it is often more practical to use numerical approximation or "numerical differentiation," which involves using the difference between values. Math textbooks may not touch upon this, but it is a useful technique to treat differentiation as subtraction. In fact, this technique is used in various applications, possibly without you even realizing it.

微分とはある関数の変化の割合、グラフの傾きを求めることで、動きや形を扱ったり物理のシミュレーションをする上で非常に重要な概念です。コンピュータで微分を扱うときには厳密な数式の変形ではなく、「数値微分」という数値の差を用いた近似の方が実用的なことが多くあります。微分を見たら引き算にしてしまえ、というのは数学の本には書いてないけれど、実は様々な場所で使われている(多分あなたも知らずに既に使っている)重要なテクニックです。