   Barycentric, Spherical, and Cartesian coordinates
  I'm either making a crazy mistake or I misunderstand how different coordinate systems relate to each other.  At the moment I take a triangle, defined by 3 cartesian points in 3D, and subdivide it to form 4 triangles by taking the midpoint of each line on the triangle and forming a new vertex there.  I then normalize the vertex, so all the points lie on the unit sphere.  Fairly standard.I'm trying to find a way to unroll the recursive nature of this subdivision.  I'd like to be able to specify a point as some linear combination of base triangle, and get back what the subdivided vertex would be.  Basically barycentric coordinates.I had the idea that if I converted my original triangle to spherical coordinates, and ignored the r term, I could entirely bypass the whole issue of normalizing the vertex after each subdivision, which was the main problem trying to unroll the subdivision.The procedure would basically consist of converting the main triangle to spherical coordinates, finding the barycentric coordinates of the point in question, and converting back to cartesian coordinates (or maybe staying with spherical coordinates and I'd refit the rest of the engine to be spherical instead of cartesian, I hadn't decided).However, there seems to be a fundamental flaw in my thinking.  Here's my maple worksheet:with(LinearAlgebra);> A := RandomVector(3);> B := RandomVector(3);> C := RandomVector(3);[-72][   ]A := [ -2][   ][-32][ 27][   ]B := [-93][   ][-76][-98][   ]C := [-77][   ][ 57]> > Barycentric := proc(A, B, C, a, b, c) (a * A + b * B + c * C) / (a + b + c); end proc;> SphericalConversion := proc(vect) <arctan(vect[3] / vect[1]), arccos(vect[2] / Norm(vect, 2)), Norm(vect, 2)>; end proc;> CartesianConversion := proc(vect) <sin(vect[2]) * cos(vect[1]), cos(vect[2]), sin(vect[2]) * sin(vect[1])> * vect[3]; end proc;> CartesianConversion(SphericalConversion(<1., 1., 1.>));    [1.00000000019117374]    [    ]    [0.99999999967155840]    [    ]    [1.00000000019117374]> Flat := Barycentric(A, B, C, 1., 1., 1.);   [-47.6666666619000098]   []Flat := [-57.3333333276000161]   []   [-16.9999999983000052]> Round := simplify(CartesianConversion(Barycentric(SphericalConversion(A), SphericalConversion(B), SphericalConversion(C), 1., 1., 1.)));  [89.80679921 ]  [  ]   Round := [-53.45336178]  [  ]  [-42.94019337]> Norm(Round, 2);112.988420984549620> Norm(Flat, 2);76.4736701162732260> (Norm(A, 2.) +> Norm(B, 2.) +> Norm(C, 2.)) / 3.;    112.9884210> Normalize(Round);> Normalize(Flat);   [ 0.99999999972705456 ]   [ ]   [-0.595203951545108744]   [ ]   [-0.478139670225528724]   [-0.831395348986860627]   [ ]   [-1.00000000018000024 ]   [ ]   [-0.296511627960348966]> Put more simply, the midpoint between two points in Cartesian space isn't the same as the midpoint between the same points in Spherical space.  In fact, it's apparently not even close.The weird thing is that this works in 2D.  If you take a line defined as two <x,y> vectors, and find the midpoint between them, it's the same point as finding the midangle between the two polar angles and converting back to cartesian.Why doesn't this work for spherical coordinates?  And is there a simpler way of unrolling the subdivision?   
  I think I'm closer to a solution.  The problem is that, for spherical coordinates, you don't really have a triangle so much as an intersection of 3 great circles.  This article briefly explores the idea and a possible solution.  I still need to work it out to see what it's talking about, but things look promising so far.   