{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Oregon Curriculum Network](http://www.4dsolutions.net/ocn)
\n",
"[Discovering Math with Python](Introduction.ipynb)\n",
"\n",
"\n",
"# Five Octahedrons in S* Module Volumes\n",
"\n",
"\n",
"\n",
"This is a cut and paste job, working from notes messaged by David Koski to [Casey House](https://www.ilovecaseyhouse.com/) and myself. It's about the volume of Five Octahedrons (a five-fold symmetric non-convex shape -- it has \"bumps\").\n",
"\n",
"My goal is to verify David's numbers using the extended precision library [gmpy2](https://gmpy2.readthedocs.io/en/latest/).\n",
"\n",
"The precision is expressed in bits, not decimal digits. 100 is already well beyond what a native floating point [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754) would contain. If using a live version of this Notebook, you'll be able to take control of the context, including how many bits.\n",
"\n",
"Lets go with 200 bits this time. You'll start to see discrepancies in the least significant digits, which is to be expected."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import gmpy2\n",
"gmpy2.get_context().precision=200"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mpfr('1.6180339887498948482045868343656381177203091798057628621354484',200)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"root5 = gmpy2.sqrt(5)\n",
"root2 = gmpy2.sqrt(2)\n",
"Ø = (1 + root5)/2\n",
"Ø"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" s12 = 0.00014001679103629136258724096203699966688007490164541515572523037\n",
" s9 = 0.00059312064482111343538172207721480972171960661370048746793462091\n",
" s6 = 0.0025124993703207451041141292708962385537585013564473650274637142\n",
" s3 = 0.010643118126104093851838239160799763936753612039489947577789477\n",
" S = 0.045084971874737120511467085914095294300772949514407155338621598\n",
" S3 = 0.19098300562505257589770658281718094113984541009711856893227582\n",
" S6 = 0.8090169943749474241022934171828190588601545899028814310677248\n"
]
}
],
"source": [
"S = (Ø **-5)/2 # home base Smod\n",
"S3 = S * Ø**3 # capital s, phi up\n",
"S6 = S3 * Ø**3 # phi up yet again\n",
"# and so on\n",
"\n",
"s3 = S * Ø**-3 # small s, phi down\n",
"s6 = s3 * Ø**-3\n",
"s9 = s6 * Ø**-3 \n",
"s12= s9 * Ø**-3\n",
"\n",
"for i in 's12, s9, s6, s3, S, S3, S6'.split(\",\"):\n",
" print(\"{:>4} =\".format(i), eval(i))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The S may be expressed in terms of phi-scaled versions of itself."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mpfr('0.045084971874737120511467085914095294300772949514407155338621637',200)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"S = 4*s3 + s6 # synonyms\n",
"S"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"The five octahedrons are presumed to have edges 2R, the same edge used for the unit volume tetrahedron, and for the 12-around-1 cuboctahedron. The dissection by David Koski was done in [vZome](http://vzome.com/home/)."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mpfr('6.3343685400050472861798319504493703494251593693233826174984788',200)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Koski writes:\n",
"FiveOcta = 132 * S + 36 * s3\n",
"RD6 = 126*S + 30*s3\n",
"# 1/10 of RTW is 6S+6s3\n",
"# adding them together gets the result\n",
"# Whew\n",
"FiveOcta"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mpfr('6.00000000000000000000000000000000000000000000000000000000001',200)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"RD6"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mpfr('6.3343685400050472861798319504493703494251593693233826174984788',200)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"FiveOcta2 = 10116 * s9 + 2388 * s12\n",
"FiveOcta2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"David: \"So, the beauty of working with these bits is that I can move them around.\""
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"6.3343685400050472861798319504493703494251593693233826174984788\n",
"6.3343685400050472861798319504493703494251593693233826174984738\n",
"6.3343685400050472861798319504493703494251593693233826174984738\n",
"6.3343685400050472861798319504493703494251593693233826174984788\n"
]
}
],
"source": [
"for i in 132*S + 36*s3, 564*s3 + 132*s6, 2388*s6 + 564*s9, 10116*s9 + 2388*s12:\n",
" print(i)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"