<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Oregon Curriculum Network <br />
Discovering Math with Python
All Aboard the S Train!
Those of us exploring the geometry of thinking laid out in Synergetics (subtitled explorations in the geometry of thinking) will be familiar with the Jitterbug Transformation, popularized in this Youtube introduction to the International Mathematicians Union logo
Step1:  The cuboctahedron and icosahedron are related by having the same edge length.  The ratio of the two, in terms of volume, is
Step2:  Icosa * sfactor = Cubocta.
Step3:  The cuboctahedron that jitterbugs into an icosahedron takes twenty regular tetrahedrons -- in volume, eight of them so formed (the other twelve paired in six half-octahedra) -- into twenty irregular tetrahedrons in the corresponding regular icosahedron (same surface edge lengths).  
Each of those 20 irregular tetrahedrons we may refer to as an "icosatet" (IcosaTet).
The computation below shows the icosatet (1/sfactor) times 20, giving the same volume as the "Jitterbug icosa" (edges 2R).
Step4:  From Figure 988.00 in Synergetics
Step5:  Verifying S Module Volume
The "skew icosahedron" inside the volume 4 octahedron is what we use to derive the 24 S modules, which make up the difference in volume between the two.  The S module's volume may also be expressed in terms of φ.
Step6:  Lets look at the S module in more detail, and compute its volume from scratch, using a Python formula.
<a data-flickr-embed="true"  href="https
Step7:  Setting a = 2 give us the following edges table
Step8:  The S Train
The fact that the cuboctahedron and icosahedron relate in two ways via a common S-factor suggests the metaphor of a train or subway route.  
Start at the cuboctahedron and follow the Jitterbug Pathway (one stop, one application of the S-factor, but as a reciprocal, since we're dropping in volume). 
We've arrived at the Jitterbug icosahedron. Applying 1/S twice more will take us to another cuboctahedron (dubbed "SmallGuy" in some writings).  Its triangular faces overlap those of the Jitterbug icosahedron.
Step9:  SmallGuy's edges are 2R times 1/sfactor, since linear change is a 3rd root of volumetric change (when shape is held constant). 
Interestingly, this result is one tenth the JB_icosahedron's volume, but a linear measure in this instance.
Step10:  When going in the other direction (smaller to bigger), apply the S factor directly (not the reciprocal) since the volumes increase.  
For example start at the cuboctahedron of volume 2.5, apply the S factor twice to get the corresponding skew icosahedron ("Icosahedron Within"), its faces embedded in the same volume 4 octahedron (see above).
S is for "Skew"...
However, we might also say "S" is for "Sesame Street" and for "spine" as the Concentric Hierarchy forms the backbone of Synergetics and becomes the familiar neighborhood, what we keep coming back to.  
... and for "Subway"
The idea of scale factors taking us from one "station stop" to another within the Concentric Hierarchy jibes with the "hypertoon" concept
Step11:  The SuperRT is the RT defined by the Jitterbug icosa (JB_icosa) and its dual, the Pentagonal Dodecahedron of tetravolume $3\sqrt{2}(\phi^2 + 1)$.
The S train through the 2.5 cubocta, which stops at "Icosa Within" does not meet up with S train through 20 cubocta, which runs to SmallGuy. 
The 20 and 2.5 cubocta stations are linked by "Double D express" (halve or double all edge lengths). 
$$Cubocta 20 \rightarrow DoubleD \rightarrow Cubocta 2.5 \rightarrow S^2 \rightarrow Icosa Within \rightarrow + 24 Smods \rightarrow Octa4$$ 
The Phi Commuter does a lot of the heavy lifting, multiplying all edges by phi or 1/phi, as in the ...e6, e3, E, E3, E6... progression.
Multiplying edges by x entails multiplying volume by $x^3$.
Take Phi Commuter from SuperRT to the 120 E Mods RT (with radius R), get off and transfer to the T Mods RT (mind the gap of ~0.9994), then take the local to the 7.5 RT. 
The space-filling RD6 will be at the same corner (they share vertexes).
<a data-flickr-embed="true"  href="https
<ASSISTANT_TASK:>
Python Code:
from IPython.display import YouTubeVideo
YouTubeVideo("1VXDejQcAWY")
Explanation: Oregon Curriculum Network <br />
Discovering Math with Python
All Aboard the S Train!
Those of us exploring the geometry of thinking laid out in Synergetics (subtitled explorations in the geometry of thinking) will be familiar with the Jitterbug Transformation, popularized in this Youtube introduction to the International Mathematicians Union logo:
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/46320625832/in/dateposted-public/" title="imu_logo_u2be"><img src="https://farm5.staticflickr.com/4815/46320625832_7c33a06f9e.jpg" width="500" height="461" alt="imu_logo_u2be"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
End of explanation
import gmpy2
gmpy2.get_context().precision=200
root2 = gmpy2.sqrt(2)
root7 = gmpy2.sqrt(7)
root5 = gmpy2.sqrt(5)
root3 = gmpy2.sqrt(3)
# phi
𝜙 = (gmpy2.sqrt(5) + 1)/2
# Synergetics modules
Smod = (𝜙 **-5)/2  
Emod = (root2/8) * (𝜙 ** -3)
sfactor = Smod/Emod
print("sfactor: {:60.57}".format(sfactor))
Explanation: The cuboctahedron and icosahedron are related by having the same edge length.  The ratio of the two, in terms of volume, is: $20 : 5 \sqrt{2} \phi^2$.  
Lets call this the "S factor". It also happens to be the Smod/Emod volume ratio.
End of explanation
sfactor = 2 * root2 * 𝜙 ** -2   # 2 * (7 - 3 * root5).sqrt()
print("sfactor: {:60.57}".format(sfactor))
# sfactor in terms of phi-scaled emods
e3 = Emod * 𝜙 ** -3
print("sfactor: {:60.57}".format(24*Emod + 8*e3))
# length of skew icosa edge EF Fig 988.13A below, embedded in 
# octa of edge a=2
EF = 2 * gmpy2.sqrt(7 - 3 * root5)
print("sfactor: {:60.57}".format(EF))
Explanation: Icosa * sfactor = Cubocta.
End of explanation
icosatet = 1/sfactor
icosatet
JB_icosa = 20 * icosatet
print("Icosahedron: {:60.57}".format(JB_icosa))  # for volume of JB icosahedron
Explanation: The cuboctahedron that jitterbugs into an icosahedron takes twenty regular tetrahedrons -- in volume, eight of them so formed (the other twelve paired in six half-octahedra) -- into twenty irregular tetrahedrons in the corresponding regular icosahedron (same surface edge lengths).  
Each of those 20 irregular tetrahedrons we may refer to as an "icosatet" (IcosaTet).
The computation below shows the icosatet (1/sfactor) times 20, giving the same volume as the "Jitterbug icosa" (edges 2R).
End of explanation
icosa_within = 2.5 * sfactor * sfactor
icosa_within
Explanation: From Figure 988.00 in Synergetics:
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/46319721212/in/dateposted-public/" title="Jitterbug Relation"><img src="https://farm5.staticflickr.com/4908/46319721212_5144721a96.jpg" width="500" height="295" alt="Jitterbug Relation"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<div align="center">Jitterbug Relationship</div>
The S Train is Leaving the Station...
However there's another twinning or pairing of the cubocta and icosa in Synergetics that arises when we fit both into a contextualizing octahedron.  
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/46009103944/in/dateposted-public/" title="Phi Scaled S Module"><img src="https://farm5.staticflickr.com/4847/46009103944_bda5a5f0c3.jpg" width="500" height="500" alt="Phi Scaled S Module"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
Consider the canonical octahedron of volume 4, with a cuboctahedron inside, its triangular faces flush with the octahedron's.  Its volume is 2.5.
Now consider an icosahedron with eight of its twenty faces flush to the same octahedron, but skewed (tilted) relative to the cuboctahedron's.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/31432640247/in/dateposted-public/" title="icosa_within"><img src="https://farm5.staticflickr.com/4876/31432640247_14b56cdc4b.jpg" width="500" height="409" alt="icosa_within"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<div align="center">From Figure 988.12 in Synergetics by RBF</div>
The relationship between this pair is different than in the Jitterbug Transformation.  For one thing, the edges are no longer the same length, and for another, the icosahedron's edges are longer, and its volume is greater.
However, despite these differences, the S-Factor is still involved.  
For one thing: the longer edge of the icosahedron is the S-factor, given edges and radii of the cuboctahedron of volume 2.5 are all R = 1 = the radius of one CCP sphere -- each encased by the volume 6 RD (see below).
From Figure 988.00 in Synergetics:
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/46319721512/in/dateposted-public/" title="Skew Relationship"><img src="https://farm5.staticflickr.com/4827/46319721512_e1f04c3ca2.jpg" width="500" height="272" alt="Skew Relationship"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<div align="center">Cuboctahedron and Icosahedron<br /> both with faces flush to Octahedron of volume 4</div>
For another:  the cuboctahedron's volume, times S-Factor to the 2nd power, gives the icosahedron's volume.
End of explanation
smod = (4 - icosa_within)/24
print("smod: {:60.57}".format(smod))
(𝜙**-5)/2 
print("smod: {:60.57}".format(smod))
Explanation: Verifying S Module Volume
The "skew icosahedron" inside the volume 4 octahedron is what we use to derive the 24 S modules, which make up the difference in volume between the two.  The S module's volume may also be expressed in terms of φ.
End of explanation
import tetvols
# assume a = 1 D
a  = 1 
# common apex is F
FH = 1/𝜙
FE = sfactor/2
FG = root3 * FE/2
# connecting the base (same order, i.e. H, E, G)
HE = (3 - root5)/2
EG = FE/2
GH = EG
Smod = tetvols.ivm_volume((FH, FE, FG, HE, EG, GH))
print("smod: {:60.57}".format(Smod))
print("Octa Edge = 1")
print("FH: {:60.57}".format(FH))
print("FE: {:60.57}".format(FE))
print("FG: {:60.57}".format(FG))
print("HE: {:60.57}".format(HE))
print("EG: {:60.57}".format(EG))
print("GH: {:60.57}".format(GH))
Explanation: Lets look at the S module in more detail, and compute its volume from scratch, using a Python formula.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/45589318711/in/dateposted-public/" title="dejong"><img src="https://farm2.staticflickr.com/1935/45589318711_677d272397.jpg" width="417" height="136" alt="dejong"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<br />
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/32732893998/in/dateposted-public/" title="smod_dimensions"><img src="https://farm5.staticflickr.com/4892/32732893998_cd5f725f3d.jpg" width="500" height="484" alt="smod_dimensions"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
Picking a common apex for three lengths (radials), and then connecting the dots around the base so defined, is step one in using our algorithm.  We'll use gmpy2 for its extended precision capabilities.
The Tetrahedron class in tetravolume module is set by default to work in D units (D = 2R) i.e. the canonical tetrahedron, octahedron, icosahedron, all have edges 1.
End of explanation
print("Octa Edge = 2")
print("FH: {:60.57}".format(FH * 2))
print("FE: {:60.57}".format(FE * 2))
print("FG: {:60.57}".format(FG * 2))
print("HE: {:60.57}".format(HE * 2))
print("EG: {:60.57}".format(EG * 2))
print("GH: {:60.57}".format(GH * 2))
Explanation: Setting a = 2 give us the following edges table:
End of explanation
SmallGuy = 20 * (1/sfactor) ** 3
SmallGuy
print("SmallGuy: {:60.57}".format(SmallGuy))
Explanation: The S Train
The fact that the cuboctahedron and icosahedron relate in two ways via a common S-factor suggests the metaphor of a train or subway route.  
Start at the cuboctahedron and follow the Jitterbug Pathway (one stop, one application of the S-factor, but as a reciprocal, since we're dropping in volume). 
We've arrived at the Jitterbug icosahedron. Applying 1/S twice more will take us to another cuboctahedron (dubbed "SmallGuy" in some writings).  Its triangular faces overlap those of the Jitterbug icosahedron.
End of explanation
print("SmallGuy Edge:  {:56.54}".format(2 * (1/sfactor)))  # SmallGuy edge
print("Icosahedron:    {:56.53}".format(JB_icosa))  # for volume of JB icosahedron
Explanation: SmallGuy's edges are 2R times 1/sfactor, since linear change is a 3rd root of volumetric change (when shape is held constant). 
Interestingly, this result is one tenth the JB_icosahedron's volume, but a linear measure in this instance.
End of explanation
Syn3 = gmpy2.sqrt(gmpy2.mpq(9,8))
JB_icosa = SmallGuy * sfactor * sfactor
print("JB Icosa:   {:60.57}".format(JB_icosa))
JB_cubocta = JB_icosa * sfactor
print("JB Cubocta: {:60.57}".format(JB_cubocta))
SuperRT = JB_cubocta * Syn3
SuperRT  # 20*S3
print("SuperRT:    {:60.57}".format(SuperRT))
Explanation: When going in the other direction (smaller to bigger), apply the S factor directly (not the reciprocal) since the volumes increase.  
For example start at the cuboctahedron of volume 2.5, apply the S factor twice to get the corresponding skew icosahedron ("Icosahedron Within"), its faces embedded in the same volume 4 octahedron (see above).
S is for "Skew"...
However, we might also say "S" is for "Sesame Street" and for "spine" as the Concentric Hierarchy forms the backbone of Synergetics and becomes the familiar neighborhood, what we keep coming back to.  
... and for "Subway"
The idea of scale factors taking us from one "station stop" to another within the Concentric Hierarchy jibes with the "hypertoon" concept:  smooth transformations terminating in "switch points" from which other transformations also branch (a nodes and edges construct, like the polyhedrons themselves).
Successive applications of both S and Syn3 take us to "station stops" along the "S train" e.g. 
$$SmallGuy \rightarrow S^2 \rightarrow icosa \rightarrow S \rightarrow cubocta \rightarrow Syn3 \rightarrow RT$$ 
and so on. Bigger and bigger (or other way). 
Remember Syn3?  That's also our $IVM \Leftrightarrow XYZ$ conversion constant.  Yet here we're not using it that way, as we're staying in tetravolumes the whole time.  
However, what's so is the ratio between the volume of the cube of edges R and the volume of the tetrahedron of edges D (D = 2R) is the same as that between the RT and volume 20 cuboctahedron, where long diagonals of RT = edges of cubocta.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/21077777642/in/photolist-FRd2LJ-y7z7Xm-frqefo-8thDyL-6zKk1y-5KBFWR-5KFVMm-5uinM4" title="Conversion Constant"><img src="https://farm1.staticflickr.com/702/21077777642_9803ddb65e.jpg" width="500" height="375" alt="Conversion Constant"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<div align="center">Cube edges = 1/2 x Tetrahedron edges;<br /> Cube:Tetrahedron volume ratio = S3</div>
End of explanation
volume1 = SuperRT - JB_icosa
volume2 = (4 - 24*Smod) * (1/sfactor)
print("volume1: {:60.57}".format(volume1))
print("volume2: {:60.57}".format(volume2))
# one more application of the 1/sfactor gives the 2.5 cubocta
print("Edged 1 Cubocta: {:60.57}".format(volume2 * (1/sfactor)))
Explanation: The SuperRT is the RT defined by the Jitterbug icosa (JB_icosa) and its dual, the Pentagonal Dodecahedron of tetravolume $3\sqrt{2}(\phi^2 + 1)$.
The S train through the 2.5 cubocta, which stops at "Icosa Within" does not meet up with S train through 20 cubocta, which runs to SmallGuy. 
The 20 and 2.5 cubocta stations are linked by "Double D express" (halve or double all edge lengths). 
$$Cubocta 20 \rightarrow DoubleD \rightarrow Cubocta 2.5 \rightarrow S^2 \rightarrow Icosa Within \rightarrow + 24 Smods \rightarrow Octa4$$ 
The Phi Commuter does a lot of the heavy lifting, multiplying all edges by phi or 1/phi, as in the ...e6, e3, E, E3, E6... progression.
Multiplying edges by x entails multiplying volume by $x^3$.
Take Phi Commuter from SuperRT to the 120 E Mods RT (with radius R), get off and transfer to the T Mods RT (mind the gap of ~0.9994), then take the local to the 7.5 RT. 
The space-filling RD6 will be at the same corner (they share vertexes).
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/4178618670/in/photolist-28MC8r3-27PVk6E-27PVjh5-27PVkvN-27PViQ3-27PVjC5-KgsYkX-KgsXRk-KgsZ2B-27KsgFG-27xwi3K-9WvZwa-97TTvV-7nfvKu" title="The 6 and the 7.5"><img src="https://farm3.staticflickr.com/2767/4178618670_1b4729e527.jpg" width="500" height="456" alt="The 6 and the 7.5"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
<div align="center">RT of volume 7.5 and RD of volume 6<br /> with shared vertexes (by David Koski using vZome)</div>
The RD6's long diagonals make Octa4, your bridge to Icosa Within and the S line to the 2.5 cubocta.
$$SuperRT \rightarrow \phi Commuter \rightarrow Emod RT \rightarrow Tmod RT \rightarrow 3/2 \rightarrow 7.5 RT \rightarrow RD6 \rightarrow Octa4$$ 
This kind of touring by scale factor and switching pathways is called "taking subways around the neighborhood" (i.e. Sesame Street).
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/31433920137/in/dateposted-public/" title="Sesame Street Subway"><img src="https://farm5.staticflickr.com/4812/31433920137_ecb829e3bd.jpg" width="500" height="375" alt="Sesame Street Subway"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
Here's another one, derived by David Koski in early March, 2021:
Icosa of (Octa4 - 24 S modules) $\rightarrow$ S-factor down $\rightarrow$ the volumetric difference between SuperRT and the Jitterbug Icosa (which latter inscribes in the former as long face diagonals).
End of explanation
<END_TASK>