<div dir="ltr"><div><div><div><div><div><div><div><div><br></div>Per these paragraphs to a listserv for Physics teachers -- to which I was invited by one Dr. Bob Fuller, a former AAPT chairman -- I'm underlining a Vector type as one of the hallmarks of high school math:<br><br></div><div>=== [ posted about 2.5 hours ago ] ===<br></div><div><br><div>Your remarks on fluency are well taken.  <br><br>I'm just about to 
post something to edu-sig about the Vector class (class as in "type of 
object") and its pivotal role in grades 9-12 (as we say in this 
namespace).  That'd be along both the delta and lambda tracks, 
continuous and discrete.<br><br>Luciano Ramalho has recently published 
the book 'Fluent Python' which is appearing in several languages (I've 
met the guy a few times, been in his workshops or seen them on video).  <br><br>Luciano does a really fluent Vector type, as many dimensions as you want.  <br><br>With operator overloading, you can add them (v1 + v2), scale them (3 * v1), multiply them by matrices to get more vectors.  <br><br>You
 could say, when applying a rotation matrix, that "it's the same vector,
 just moved" but more disciplined functional programmers prefer 
immutable objects begetting new immutable objects, minimizing hidden 
(contained) state.<br><br></div><div>Even with OO languages, there's 
something called programming in a more functional way.  'Functional 
Python' by Mertz is another popular title.<br><br></div>The sympy library has a Clifford Algebra bivector submodule that I've not played with yet.<br><br>===<br><br></div><div>... continuing that thought ...<br><br></div><div>Once you have the bare bones model, the mathematical Vector, then you get to wire it up to different strategies for rendering.<br></div><br></div>A simple and mathematically correct approach has all Vectors originating at the origin, pointing to points, such that the edges of a Polyhedron around said origin are each defined by two endpoint Vectors.  e = Edge(v0, v1).<br><br></div>Rendering edges, vertexes and faces (E, V, F) is a common theme, regardless of rendering back and, be that ray tracer, Pi3D or what have you.  <br><br>This was my approach in stickworks.py -- separate model from visualization code to some degree.  I experimented with tighter and looser coupling.  <br><br>Like if you can interactively make graphics happen in a window, from a REPL in real time, so much the better.<br><br><a href="http://4dsolutions.net/ocn/python/stickworks.py">http://4dsolutions.net/ocn/python/stickworks.py</a>  (source)<br><a href="https://youtu.be/4iMSGKXJ_Ds">https://youtu.be/4iMSGKXJ_Ds</a>  (Youtube intro)<br><br></div><div>A wrinkle in my curriculum writing is we may go on to re-implement the Vector concept using "quadray coordinates" (see Wikipedia) per this Jupyter notebook:<br><br>'<a href="http://nbviewer.jupyter.org/github/4dsolutions/Python5/blob/master/Polyhedrons%20101.ipynb">http://nbviewer.jupyter.org/github/4dsolutions/Python5/blob/master/Polyhedrons%20101.ipynb</a>'<br><br></div><div>I'm thinking lots of math teachers might like to go this route, not necessarily starting with my source code or anyone else's in particular (maybe Luciano's) as an exercise in learning / teaching pure Python.<br></div><div><br>---------------------------------<br><br></div>Addendum re Raspberry Pi, as a polyhedrons rendering machine (the theme of my last two posts):<br><br></div>I'm still working with Adrian Rossiter on OpenGL issues.  His antiview runs but is not yet rendering properly<br><br><a href="https://flic.kr/p/KBCcqy">https://flic.kr/p/KBCcqy</a>  (messed up antiview view in upper right)<br><br>probably because Pi use OpenGL ES, not what he'd coded for? I may see a fix?<br><br><a href="https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=63264">https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=63264</a><br><br></div>However, when it comes to this pipeline:  <br><br>antiprism generating program -> OFF file -> off2pov -> POV -> povray<br><br>things are working great:  <br><br><a href="https://flic.kr/p/LoXhEG">https://flic.kr/p/LoXhEG</a><br><br></div>Kirby<br><br></div>