Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions docs/02advanced/03simulation/_samples/draw_circle.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {},
"cells": [
{
"metadata": {},
"source": [
"!pip install ita"
],
"cell_type": "code",
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: ita in /home/w/.local/lib/python3.10/site-packages (0.2.12)\n",
"Requirement already satisfied: numpy in /home/w/.local/lib/python3.10/site-packages (from ita) (1.23.3)\n",
"Requirement already satisfied: matplotlib in /home/w/.local/lib/python3.10/site-packages (from ita) (3.6.0)\n",
"Requirement already satisfied: cycler>=0.10 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (0.11.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (1.4.4)\n",
"Requirement already satisfied: pyparsing>=2.2.1 in /usr/lib/python3/dist-packages (from matplotlib->ita) (2.4.7)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (1.0.5)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (4.37.4)\n",
"Requirement already satisfied: pillow>=6.2.0 in /usr/lib/python3/dist-packages (from matplotlib->ita) (9.0.1)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (2.8.2)\n",
"Requirement already satisfied: packaging>=20.0 in /home/w/.local/lib/python3.10/site-packages (from matplotlib->ita) (21.3)\n",
"Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib->ita) (1.16.0)\n"
]
}
],
"execution_count": null
},
{
"metadata": {},
"source": [
"import ita\n",
"\n",
"%matplotlib inline"
],
"cell_type": "code",
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"source": [
"def draw_circle(x, y, r):\n",
" image = ita.array.make2d(100, 100)\n",
" y = len(image) - 1 - y\n",
" for i in range(y - r, y + r + 1):\n",
" for j in range(x - r, x + r + 1):\n",
" if (\n",
" 0 <= i < len(image)\n",
" and 0 <= j < len(image[i])\n",
" and (x - j) ** 2 + (y - i) ** 2 < r**2\n",
" ):\n",
" image[i][j] = 1\n",
" return image\n",
"\n",
"\n",
"image = draw_circle(10, 10, 10)\n",
"ita.plot.image_show(image)"
],
"cell_type": "code",
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAGgCAYAAADsNrNZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAYi0lEQVR4nO3df2xV9f3H8Vd/3haht1DCve1opRqSKmBEKqVg4h80I45MEWJmglsnZotatIXEATNlf7h6m5FtyuJkmowtkR+zyRQh2QwprglJ5UcdKJMVFsi4Ee5lZuu9TCiQ3vf3D/e9sfy+tPi+hecjeSdyzrm3Hz6bfebenl5zzMwEAMDXLNd7AQCAWxMBAgC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuLhhAXrttdc0adIkFRUVqa6uTrt3775RXwoAMALl3IjPgvvDH/6g733ve1q3bp3q6ur0yiuvqKOjQ729vZowYcIVH5tKpXT8+HGNGTNGOTk5w700AMANZmY6deqUKioqlJt7hdc5dgPMnDnTmpqa0n8eGBiwiooKi0QiV31sNBo1SQzDMMwIn2g0esXv98P+Fty5c+fU09OjhoaG9LHc3Fw1NDSou7v7ouvPnj2rZDKZHuPDuQHgpjBmzJgrn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XbtW+fn5CoVCOnfunPr6+gY9Lh6PKxwOD+e6AQAjXEavgObOnatPPvlk0LEnn3xSNTU1WrFihSorK1VQUKDOzk4tWrRIktTb26tjx46pvr5++FYNABjxMgrQmDFjNHXq1EHHbrvtNpWVlaWPP/XUU1q+fLnGjRunkpISPffcc6qvr9esWbOGb9UAgBEvowBdi1/+8pfKzc3VokWLdPbsWc2bN0+//vWvh/vLAABGuBwzM+9FfFUymVQwGPReBgBgiBKJhEpKSi57ns+CAwC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuCBAAAAXBAgA4IIAAQBcECAAgAsCBABwQYAAAC4IEADABQECALggQAAAFwQIAOCCAAEAXBAgAIALAgQAcEGAAAAuCBAAwAUBAgC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuCBAAAAXBAgA4IIAAQBcECAAgAsCBABwQYAAAC4IEADABQECALggQAAAFwQIAOCCAAEAXBAgAIALAgQAcEGAAAAuCBAAwAUBAgC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuCBAAAAXBAgA4IIAAQBcECAAgAsCBABwQYAAAC4yDtBnn32mJ554QmVlZSouLta0adO0d+/e9Hkz0+rVq1VeXq7i4mI1NDTo8OHDw7poAMDIl1GA/vOf/2jOnDkqKCjQn/70J3366af6+c9/rrFjx6av+dnPfqa1a9dq3bp12rVrl2677TbNmzdP/f39w754AMAIZhlYsWKFPfDAA5c9n0qlLBwO25o1a9LH+vr6LBAI2KZNmy75mP7+fkskEumJRqMmiWEYhhnhk0gkrtiUjF4Bvffee6qtrdVjjz2mCRMmaPr06XrzzTfT548ePapYLKaGhob0sWAwqLq6OnV3d1/yOSORiILBYHoqKyszWRIAYITKKEBHjhzR66+/rsmTJ+v999/XM888o+eff16///3vJUmxWEySFAqFBj0uFAqlz11o1apVSiQS6YlGo9fz9wAAjDD5mVycSqVUW1url19+WZI0ffp0HThwQOvWrVNjY+N1LSAQCCgQCFzXYwEAI1dGr4DKy8t19913Dzp211136dixY5KkcDgsSYrH44Ouicfj6XMAAEgZBmjOnDnq7e0ddOzQoUO6/fbbJUnV1dUKh8Pq7OxMn08mk9q1a5fq6+uHYbkAgJtGJnfB7d692/Lz862trc0OHz5sGzZssFGjRtlbb72Vvqa9vd1KS0tty5Yt9vHHH9sjjzxi1dXVdubMmWv6GolEwv3ODYZhGGboc7W74DIKkJnZ1q1bberUqRYIBKympsbeeOONQedTqZS1trZaKBSyQCBgc+fOtd7e3mt+fgLEMAxzc8zVApRjZqYskkwmFQwGvZcBABiiRCKhkpKSy57ns+AAAC4IEADABQECALggQAAAFwQIAOCCAAEAXBAgAIALAgQAcEGAAAAuCBAAwAUBAgC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuCBAAAAXBAgA4IIAAQBcECAAgAsCBABwQYAAAC4IEADABQECALggQAAAFwQIAOCCAAEAXBAgAIALAgQAcEGAAAAuCBAAwAUBAgC4IEAAABcECADgggABAFwQIACACwIEAHBBgAAALggQAMAFAQIAuCBAAAAXBAgA4IIAAQBcECAAgAsCBABwQYAAAC4IEADABQECALggQAAAFwQIAOCCAAEAXBAgAIALAgQAcEGAAAAuCBAAwAUBAgC4IEAAABcECADgggABAFwQIACAi4wCNDAwoNbWVlVXV6u4uFh33nmnXnrpJZlZ+hoz0+rVq1VeXq7i4mI1NDTo8OHDw75wAMAIZxloa2uzsrIy27Ztmx09etQ6Ojps9OjR9uqrr6avaW9vt2AwaO+++67t37/fHn74YauurrYzZ85c09dIJBIm6YZMNrhRfzeGYZhsm0QiceXvh5l885w/f74tWbJk0LGFCxfa4sWLzcwslUpZOBy2NWvWpM/39fVZIBCwTZs2XfI5+/v7LZFIpCcajd6wzcgG3v+HYBiG+brmagHK6C242bNnq7OzU4cOHZIk7d+/Xzt37tRDDz0kSTp69KhisZgaGhrSjwkGg6qrq1N3d/clnzMSiSgYDKansrIykyUBAEao/EwuXrlypZLJpGpqapSXl6eBgQG1tbVp8eLFkqRY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Yp2vDPl0b9unKzEynTp1SRUWFcnMv/zon6+6Cy83N1cSJE5VMJiVJJSUl/A98Ddina8M+XRv26dqwT5cXDAavek3WvQUHALg1ECAAgIusDVAgENBPfvITBQIB76VkNfbp2rBP14Z9ujbs0/DIupsQAAC3hqx9BQQAuLkRIACACwIEAHBBgAAALggQAMBF1gbotdde06RJk1RUVKS6ujrt3r3be0luIpGI7r//fo0ZM0YTJkzQggUL1NvbO+ia/v5+NTU1qaysTKNHj9aiRYsUj8edVpwd2tvblZOTo5aWlvQx9ulLn332mZ544gmVlZWpuLhY06ZN0969e9PnzUyrV69WeXm5iouL1dDQoMOHDzuu+Os3MDCg1tZWVVdXq7i4WHfeeadeeumlQR+wyT4NkWWhzZs3W2Fhof32t7+1v/3tb/aDH/zASktLLR6Pey/Nxbx582z9+vV24MAB27dvn33rW9+yqqoq++9//5u+5umnn7bKykrr7Oy0vXv32qxZs2z27NmOq/a1e/dumzRpkt1zzz3W3NycPs4+mf373/+222+/3b7//e/brl277MiRI/b+++/bP/7xj/Q17e3tFgwG7d1337X9+/fbww8/bNXV1XbmzBnHlX+92trarKyszLZt22ZHjx61jo4OGz16tL366qvpa9inocnKAM2cOdOamprSfx4YGLCKigqLRCKOq8oeJ0+eNEnW1dVlZmZ9fX1WUFBgHR0d6WsOHjxokqy7u9trmW5OnTplkydPtu3bt9uDDz6YDhD79KUVK1bYAw88cNnzqVTKwuGwrVmzJn2sr6/PAoGAbdq06etYYlaYP3++LVmyZNCxhQsX2uLFi82MfRoOWfcW3Llz59TT06OGhob0sdzcXDU0NKi7u9txZdkjkUhIksaNGydJ6unp0fnz5wftWU1Njaqqqm7JPWtqatL8+fMH7YfEPv2/9957T7W1tXrsscc0YcIETZ8+XW+++Wb6/NGjRxWLxQbtUzAYVF1d3S21T7Nnz1ZnZ6cOHTokSdq/f7927typhx56SBL7NByy7tOwP//8cw0MDCgUCg06HgqF9Pe//91pVdkjlUqppaVFc+bM0dSpUyVJsVhMhYWFKi0tHXRtKB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AOCCAAEAXBAgAICL/wPj1laaedj6LwAAAABJRU5ErkJggg==",
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f866d3da260>"
]
},
"metadata": {},
"execution_count": 12
}
],
"execution_count": null
}
]
}
39 changes: 39 additions & 0 deletions docs/02advanced/03simulation/_samples/uniform_linear_motion.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {},
"cells": [
{
"metadata": {},
"source": [
"def uniform_linear_motion_step(x, v0, dt):\n",
" return x + v0 * dt\n",
"\n",
"\n",
"def uniform_linear_motion(x0, v0, t, dt):\n",
" x = x0\n",
" n = int(t / dt)\n",
" for i in range(n):\n",
" x = uniform_linear_motion_step(x, v0, dt)\n",
" return x\n",
"\n",
"\n",
"uniform_linear_motion(0, 10, 10, 0.1)"
],
"cell_type": "code",
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"100.0"
]
},
"metadata": {},
"execution_count": 3
}
],
"execution_count": null
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {},
"cells": [
{
"metadata": {},
"source": [
"def uniform_linear_motion(x0, v0, t):\n",
" return x0 + v0 * t\n",
"\n",
"\n",
"uniform_linear_motion(0, 10, 10)"
],
"cell_type": "code",
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"100"
]
},
"metadata": {},
"execution_count": 2
}
],
"execution_count": null
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {},
"cells": [
{
"metadata": {},
"source": [
"def uniform_linear_motion_step(x, v0, dt):\n",
" return x + v0 * dt\n",
"\n",
"\n",
"def uniform_linear_motion(x0, v0, t, dt):\n",
" x = []\n",
" x.append(x0)\n",
" n = int(t / dt)\n",
" for i in range(n):\n",
" x.append(uniform_linear_motion_step(x[i], v0, dt))\n",
" return x\n",
"\n",
"\n",
"print(uniform_linear_motion(0, 10, 10, 0.1))"
],
"cell_type": "code",
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0, 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, 89.0, 90.0, 91.0, 92.0, 93.0, 94.0, 95.0, 96.0, 97.0, 98.0, 99.0, 100.0]\n"
]
}
],
"execution_count": null
}
]
}
Loading