Hmm. Where am I going wrong? Firstly, I apologise, I'm only a programmer, and skinny also, not a maths bod.
Everything is on the unit sphere
I have a spherical equilateral triangle ABC and a 2D co-ordinate (u, v). I construct P using slerp:
D = slerp(A, B, u)
E = slerp(C, B, u)
P = slerp(D, E, v)
Now, given the point P and the triangle ABC, find (u, v). So, from the construction above, it should be really straightforward:
F = normalise(cross(C, A)) : the plane of the great circle defined by A and C
G = normalise(cross(B, P)) : the plane of the great circle defined by P and B
H = cross(F, G) : the intersections of the great circles AC and PB
v = Angle(AOH) / Angle(AOC)
This works. However...
I = normalise(cross(cross(G, P), P)) : the plane of the great circle defined by D and E?
J = normalise(Cross(B, A)) : plane of the great circle defined by A and B
K = Cross(I, J) : intersection of the great circles DE and AB
u = Angle(AOK) / Angle(AOB)
I cannot see where I'm going wrong here. Any ideas? Thanks in advance!