Skip to content

Instantly share code, notes, and snippets.

@genkuroki
Last active July 2, 2017 10:05
Show Gist options
  • Save genkuroki/ce88fb9fa17d24105f0951fbb067596d to your computer and use it in GitHub Desktop.
Save genkuroki/ce88fb9fa17d24105f0951fbb067596d to your computer and use it in GitHub Desktop.
Test of markdown in Atom

Atomでのmarkdownプレビューテスト用

MathJaxによる数式表示

Gamma函数とBeta函数

$\Gamma$ 函数とBeta函数は次のように定義される. $ \newcommand\Real{\operatorname{Re}} \newcommand\Imag{\operatorname{Im}} \Real s, \Real p, \Real q > 0 $ のとき次のように定義される:

$$\begin{align*} &\Gamma(s)=\int_0^\infty e^{-x} x^{s-1}\,dx,\\\ &B(p,q)=\int_0^1 x^{p-1}(1-x)^{q-1}\,dx. \end{align*}$$

このとき次の公式が成立している:

$$\begin{align*} &\Gamma(s+1)=\Gamma(s),\qquad \Gamma(1)=1,\\\ &B(p,q)=\frac{\Gamma(p)\Gamma(q)}{\Gamma(p+q)} =2\int_0^{\pi/2}(\cos\theta)^{2q-1}(\sin\theta)^{2q-1}\,d\theta. \end{align*}$$

ゆえに $p=q=1/2$ のとき

$$\begin{gather} \Gamma(1/2)^2 = 2\int_0^{\pi/2}d\theta=\pi, \\\ \therefore \quad \Gamma(1/2)=\sqrt{\pi}. \end{gather}$$

グラフ

graph LR
  A --> B;
  B --> C;
  C --> A;

ファイルのインポート

@import "gurungurun.gif" {width:"500px"}

Code Chunk

Python

print("Hello, Python!")

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
        linewidth=0, antialiased=False)
ax.set_zlim3d(-1.01, 1.01)

ax.w_zaxis.set_major_locator(LinearLocator(10))
ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f'))

fig.colorbar(surf, shrink=0.5, aspect=5)

plt.show() # show figure

Julia

println("Hello, Julia!")
using SymPy
@vars x y
f = x^y
println(integrate(f,x))
g = 1/(1+x^2)
println(integrate(g,(x,-Inf,Inf)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment