Math Symbols
Summation
The addition of a sequence of numbers
python
def summation(start,end):
running_sum = 1
for i in range(start,end):
running_sum += (2*i) + 1
return running_sum
print(summation(1,100))
Big PI
The multiplication of a sequence of numbers
python
def pi(start,end):
running_product = 1
for i in range(start, end + 1):
running_product *= i
return r
print(pi(1,6))
Dot Product
Combine two vectors
python
def dot_product(self,a, b):
dp = 0
for i in range(len(a)):
dp += (a[i]*b[i])
return dp
vector1 = [1,2,3,4,5]
vector2 = [2,1,1,1,1]
print(dot_product(vector1, vector2))
Piece Wise
A function built from pieces of different functions over different intervals
python
def f(x):
if (x >= 1):
return (math.pow(x, 2) - x) / x
else:
return 0
https://github.com/Experience-Monks/math-as-code/blob/master/PYTHON-README.md
Slope formula logrithms matrix math dot product algebra basics
MathJax
When
Maxwell's equations:
equation | description |
---|---|
divergence of | |
curl of | |
wha? |
More Jax
followed by a display style equation:
md
$$V_{sphere} = \frac{4}{3}\pi r^3$$
md
$$f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz$$
md
$$\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2}$$
md
$$\vec{\nabla} \times \vec{F} =
\left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i}
+ \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j}
+ \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k}$$
md
$$\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2}$$
Limits
md
$\lim\limits_{x\mapsto 1}\dfrac1x$
Matrices
md
$\begin{bmatrix}
i&j&k\\x_1&y_1&z_1\\x_2&y_2&z_2\\x_3&y_3&z_3
\end{bmatrix}$
Derivatives
md
$\displaystyle \frac{d\hat{\mathbf r}}{d\theta}$
Integrals
md
$\displaystyle \int_{y_0}^{y_1} \int_{x_0}^{x_1} f(x, y) \,dx\,dy$
Piecewise
md
$$f(n) =\begin{cases}
n/2, &\text{if $n$ is even} \\
3n+1, &\text{if $n$ is odd}
\end{cases}$$
Determinant
md
$$\begin{vmatrix}
1 & x_{0} & x_{0}^{2} & \dots & x_{0}^{n} \\
1 & x_{1} & x_{1}^{2} & \dots & x_{1}^{n} \\
\hdotsfor{5} \\
1 & x_{n} & x_{n}^{2} & \dots & x_{n}^{n}
\end{vmatrix}$$
Logarithm
md
$log_{b}m$
Superscripts and Subscripts
md
$x_i^3+3x_i^2x_j+3x_ix_j^2+x_j^3$
Fractions
md
$\frac{n(n+1)}{2}$