<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Martian Volume
Whoever heard of a linear algebra with four independent basis vectors in 3-space, which basis vectors are not unit length?  
This all sounds absurd. 
Welcome to Quadrays.
Step1:  The Quadray coordinate system stands on its own without merging with 20th Century Neoplatonist esoterica. Some of the shoptalk which follows is inessential to the system's other applications, insofar as it has any.
However, if we do go ahead with that merger, this apparatus proves useful in breaking the "spell", the "bewitchment of our intelligence" (Wittgenstein) by the dogma that space has to be 3D. 
Have we no choice but to accept the three mutual orthogonals, X, Y and Z, as definitive?  Could a different "dimension talk" be imagined?
In this alternative, alien, lingo, we draw attention to the tetrahedron (the 4-faced enclosure) as the simplest imaginable.  
<a data-flickr-embed="true"  href="https
Step3:  In the demonstration below, we're showing any three positive scalars s0, s1, s2, used to stretch three vectors (or shrink them), p, q, r, from the corner of a regular tetrahedron, define a tetrahedron of volume s0 * s1 * s2.
In other words, instead of using the three positive orthogonal basis vectors, imagined at the corner of a cube (say the positive octant in XYZ), we're using unit length vectors from the corner of a regular tetrahedron.  These are not the Qray basis vectors, but they do demonstrate how we define volume and by extension 3rd powering.
The picture below is from one of the figures published in Synergetics.
<a data-flickr-embed="true"  href="https
Step4:  What's the volume formula we're using?  A simple conversion constant will take us from XYZ to IVM volume, but the algorithm below returns the IVM volume natively.  It's the XYZ volume we use the constant to derive.
The make_tet function computes the missing three lengths, given three from a corner (the edges between vector tips), and returns the IVM volume of the tetrahedron so formed.
The formula below, similar to one of Euler's (with a history before that) and derived by Gerald de Jong (University of Toronto undergrad), requires edge lengths only, but all six of them.
<a data-flickr-embed="true"  href="https
<ASSISTANT_TASK:>
Python Code:
from qrays import Qvector, Vector
a = Qvector((1,0,0,0))
a.length()
b = Qvector((0,1,0,0))
(a-b).length()
Explanation: Martian Volume
Whoever heard of a linear algebra with four independent basis vectors in 3-space, which basis vectors are not unit length?  
This all sounds absurd. 
Welcome to Quadrays.
End of explanation
from tetvols import make_tet
import unittest
class TestQuadrays(unittest.TestCase):
    
    def test_martian(self):
        p = Qvector((2,1,0,1))
        q = Qvector((2,1,1,0))
        r = Qvector((2,0,1,1))
        result = make_tet(5*q, 2*p, 2*r) # three scalars
        self.assertAlmostEqual(result[0], 20, 7)
        
if __name__ == '__main__':
    unittest.main(argv=['first-arg-is-ignored'], exit=False)
Explanation: The Quadray coordinate system stands on its own without merging with 20th Century Neoplatonist esoterica. Some of the shoptalk which follows is inessential to the system's other applications, insofar as it has any.
However, if we do go ahead with that merger, this apparatus proves useful in breaking the "spell", the "bewitchment of our intelligence" (Wittgenstein) by the dogma that space has to be 3D. 
Have we no choice but to accept the three mutual orthogonals, X, Y and Z, as definitive?  Could a different "dimension talk" be imagined?
In this alternative, alien, lingo, we draw attention to the tetrahedron (the 4-faced enclosure) as the simplest imaginable.  
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/4723083407/in/photolist-jnjYkJ-dXVxsM-8cn39x-kreNGK-dj1wJw-jjQPyH-jjRh9s-jjPxdF-eVX8tk-jjTX9Q-GsURhL-jKwah8-QZehHh-Py8HBr-Gdbvd3" title="Quadray Coordinates"><img src="https://live.staticflickr.com/1213/4723083407_2ccf6bc229.jpg" width="400" height="350" alt="Quadray Coordinates"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
We might say the sphere is simpler, but what if we're exploring a discontinuous, discrete approach?  
Real spheres such as found in nature have lots of surface details, which we tune out in our idealizations.  What if we're less interested in idealizations?
Starting with the tetrahedron as our symbolic Container (that which encloses space, excluding an outside, including an inside), we note its salient fourness:  four points, four faces.  
Three points determine a plane (so-called); four non-coplaner points get us to volume.  Lets stop there.  Volume is 4D, as in four directional.  QED.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/41211295565/in/album-72157624750749042/" title="Martian Multiplication"><img src="https://live.staticflickr.com/907/41211295565_59145e2f63.jpg" width="500" height="312" alt="Martian Multiplication"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
We say the four Qvectors are linearly independent because negating a vector is rotating and our definition of "linear combination of" does not include rotation as an operation.  We don't need the negative Qrays (Qvectors) even though we're free to use them.
Also, Qrays are such that it's the edges of the unit volume tetrahedron they define, the edges between their vector tips, that matter most in terms of length.  
What we call the "prime vector radius" is the unit radius of a sphere (we do have spheres in Martian Math).
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/4949799682" title="Tetrahedron"><img src="https://live.staticflickr.com/4143/4949799682_327b33e8d5.jpg" width="375" height="500" alt="Tetrahedron"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
This is not the way Earthlings talk.  Three mutually perpendicular lines define res extensa and therefore space is 3D.  Furthermore, although we cannot visualize a fourth orthogonal, the algebra still works, as does a definition of polytopes.  Everything feels very Euclidean.  We call nD geometry "extended Euclidean" geometry and regard H.S.M. Coxeter (University of Toronto) as one of its champions.
This more alien 4D talk wound up in a corner of American literature seldom visited in today's university track courseware.  
I'm speaking of Buckminster Fuller's Synergetics in two volumes (Macmillan), developed in collaboration with many, but especially in cahoots with E.J. Applewhite, one of his earliest fans.  
Applewhite went on the write Paradise Mislaid investigating the scientific meaning of "alive" versus "not alive" (is a virus alive?).
End of explanation
def martian_volume(s0, s1, s2):
    
    p, q, r are unit vectors from the corner of a 
    regular unit volume tetrahedron, expressed using
    Quadray coordinates.  Stretch or shrink using any
    three scalars, even negatives which reverse a 
    vector
    
    p = Qvector((2,1,0,1))
    q = Qvector((2,1,1,0))
    r = Qvector((2,0,1,1))
    result = make_tet(s0*q, s1*p, s2*r)
    return result[0]
float("{:5f}".format(martian_volume(.5, .5, .5)))
p = Qvector((2,1,0,1))
p.length()
Explanation: In the demonstration below, we're showing any three positive scalars s0, s1, s2, used to stretch three vectors (or shrink them), p, q, r, from the corner of a regular tetrahedron, define a tetrahedron of volume s0 * s1 * s2.
In other words, instead of using the three positive orthogonal basis vectors, imagined at the corner of a cube (say the positive octant in XYZ), we're using unit length vectors from the corner of a regular tetrahedron.  These are not the Qray basis vectors, but they do demonstrate how we define volume and by extension 3rd powering.
The picture below is from one of the figures published in Synergetics.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/36545769791" title="tetrahedroning"><img src="https://live.staticflickr.com/4403/36545769791_5a77c2073a.jpg" width="330" height="422" alt="tetrahedroning"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
End of explanation
from IPython.display import YouTubeVideo
YouTubeVideo("F9ZVCSPIUls")
Explanation: What's the volume formula we're using?  A simple conversion constant will take us from XYZ to IVM volume, but the algorithm below returns the IVM volume natively.  It's the XYZ volume we use the constant to derive.
The make_tet function computes the missing three lengths, given three from a corner (the edges between vector tips), and returns the IVM volume of the tetrahedron so formed.
The formula below, similar to one of Euler's (with a history before that) and derived by Gerald de Jong (University of Toronto undergrad), requires edge lengths only, but all six of them.
<a data-flickr-embed="true"  href="https://www.flickr.com/photos/kirbyurner/39391693474" title="Computer Volume"><img src="https://live.staticflickr.com/4672/39391693474_c6c54f3d22.jpg" width="500" height="463" alt="Computer Volume"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
The Youtube below does not pop up in the Github rendering.
Click here for the nbviewer version, or follow this link to the Youtube.
End of explanation
<END_TASK>