[The question was, given three vectors in R^3 with known angles between all three pairs, how far is the farthest vector from these three? That is, if v makes the same angle with v1, v2, and v3, then what _is_ that common angle, as a function of the angles between pairs of v_i. Below we write L_i for the a linear form whose nullspace is the plane perpendicular to v_i; that is, L_i([X,Y,Z]) = aX+bY+cZ if v_i = [A,B,C] -- djr] ============================================================================== From: Dave Rusin Date: Fri, 9 Oct 1998 20:29:46 -0500 (CDT) To: jthunder@math.niu.edu Subject: Told you it's trivial! Jeff It's trivial. Rotate the whole figure so the middle vector you're looking for points straight up. Then having all three original vectors at the same angle means they all point through the "arctic" circle. Assign and then eliminate coordinates to get the relations among the cosines of the angles. I end up with the square of the cosine L_i(x) of the common angle being a certain symmetric rational function of the other three cosines (which are your L_i \cdot L_j). Voici la session de Maple: |\^/| Maple V Release 4 (Northern Illinois University) ._|\| |/|_. Copyright (c) 1981-1996 by Waterloo Maple Inc. All rights \ MAPLE / reserved. Maple and Maple V are registered trademarks of <____ ____> Waterloo Maple Inc. | Type ? for help. #Tell it how to compute inner products > ip:=proc(a,b) a[1]*b[1]+a[2]*b[2]+a[3]*b[3]: end: #Assign coordinates to the north pole and to the three other vectors > P0:=[0,0,r0]: > for i to 3 do P.i:=[x.i,y.i,z.i]: od: #If the three angles are equal, and we fix the P.i to have the same #length as P0, then the three P.i have the same z coordinate. Also we #can spin the whole shebang around so P1 lies in the x-z plane. > z1:=z:z2:=z:z3:=z:y1:=0: #So now, assert that the four all have the same lengths, and give names #to the other three inner products > eq:=[ip(P0,P0)=R0,ip(P1,P1)=R0,ip(P2,P2)=R0,ip(P3,P3)=R0,ip(P1,P2)=c3,ip(P2,P3)=c1,ip(P3,P1)=c2]; 2 2 2 2 2 2 2 2 2 eq := [r0 = R0, x1 + z = R0, x2 + y2 + z = R0, x3 + y3 + z = R0, 2 2 2 x1 x2 + z = c3, x2 x3 + y2 y3 + z = c1, x3 x1 + z = c2] #Our goal now is to eliminate all the coordinates r0; x1,x2,x3,y2,y3 #(except the coordinate z, which is more or less what we seek) #and keep only the inner products c1,c2,c3 and =R0*z, as well #as the common squared-length R0. Seven equations "eq" let us eliminate #the six coordinates with one remaining relation among c1 c2 c3 z R0. #Actually r0 is essentially eliminated already. #We also simplify a bit since only z^2, not z, seems to appear: > eq2:=simplify(eq,{z^2=Z}); 2 2 2 2 2 2 eq2 := [r0 = R0, x1 + Z = R0, x2 + y2 + Z = R0, x3 + y3 + Z = R0, x1 x2 + Z = c3, x2 x3 + y2 y3 + Z = c1, x3 x1 + Z = c2] #Here goes x1: > eq3:=simplify(eq2,{x1^2=solve(eq2[2],x1^2)}); 2 2 2 2 2 eq3 := [r0 = R0, R0 = R0, x2 + y2 + Z = R0, x3 + y3 + Z = R0, x1 x2 + Z = c3, x2 x3 + y2 y3 + Z = c1, x3 x1 + Z = c2] #And now x2, x3: > eq4:=factor(subs({x2=solve(eq3[5],x2),x3=solve(eq3[7],x3)},eq3)); 2 2 2 2 2 2 Z - 2 Z c3 + c3 + y2 x1 + Z x1 eq4 := [r0 = R0, R0 = R0, ----------------------------------- = R0, 2 x1 2 2 2 2 2 Z - 2 Z c2 + c2 + y3 x1 + Z x1 ----------------------------------- = R0, c3 = c3, 2 x1 2 2 2 Z - Z c2 - Z c3 + c3 c2 + y2 y3 x1 + Z x1 -------------------------------------------- = c1, c2 = c2] 2 x1 #Oops -- shoulda eliminated in the other order, Oh well, I can fix it: > eq5:=simplify(eq4,{x1^2=solve(eq2[2],x1^2)}); 2 2 2 2 y2 R0 + c3 + R0 Z + (-2 c3 - y2 ) Z eq5 := [r0 = R0, R0 = R0, ------------------------------------- = R0, -Z + R0 2 2 2 y3 R0 + c2 + R0 Z + (-2 c2 - y3 ) Z ------------------------------------- = R0, c3 = c3, -Z + R0 R0 Z + y2 y3 R0 + c3 c2 + (-c2 - c3 - y2 y3) Z ---------------------------------------------- = c1, c2 = c2] -Z + R0 #Ugh! Let's bring terms to the left(s), get common denominators (and #ignore the denominators): > eq6:=[seq(numer(factor(lhs(eq5[i])-rhs(eq5[i]))),i=1..nops(eq5))]; 2 2 2 2 2 eq6 := [r0 - R0, 0, y2 R0 + c3 + 2 R0 Z - 2 Z c3 - Z y2 - R0 , 2 2 2 2 y3 R0 + c2 + 2 R0 Z - 2 Z c2 - Z y3 - R0 , 0, R0 Z + y2 y3 R0 + c3 c2 - Z c2 - Z c3 - Z y2 y3 + c1 Z - c1 R0, 0] #Much better. OK, now get rid of y2. It's ugly, so I'll surpress output: > eq7:=factor(subs(y2=solve(eq6[6],y2),eq6)): #But we see only y3^2's remain. Actually by hand I would solve eq6 for #y2^2, y3^2, and y2y3, then get two expressions for (y2y3)^2 to equate. #But this should work anyway. > eq8:=numer(factor(subs(y3^2=solve(eq7[4],y3^2),eq7[3]))); 3 2 2 2 2 eq8 := -R0 + 3 R0 Z - 2 R0 Z c2 + R0 c2 + R0 c1 - 2 R0 c1 Z + c3 R0 2 2 2 - 2 Z c3 R0 - c2 Z - 2 c3 c2 c1 - c1 Z + 2 Z c3 c2 + 2 Z c3 c1 - c3 Z + 2 Z c2 c1 #Let's take advantage of the symmetry to re-express the answer: > eq9:=simplify(eq8,{c1+c2+c3=S,c1*c2+c2*c3+c3*c1=T,c1*c2*c3=U}); 3 2 2 eq9 := -2 U - 2 R0 Z S - R0 + 3 R0 Z + (4 Z - 2 R0) T + (-Z + R0) S #So! Now we can easily solve for Z: (I'm surprised; I thought Z would #be _algebraic_ over R0,S,T,U, not _rational_ in them!) > eq10:=factor(solve(eq9,Z)); 3 2 2 U + R0 + 2 R0 T - R0 S -------------------------- 2 2 -2 R0 S + 3 R0 + 4 T - S #Note c1=r0 * r0 * cos(theta1) = R0*cos(theta1) etc, so S = R0*(something), #T = R0^2 * (something else), etc. So all the R0's all go away where we #need them to. In other words: take R0=1, S = sum of cosines, T=sum in pairs, #U=product; then the cosine of the common angle with P0 is the sqrt of this. #Here, you needn't retype or recompute next time: > lprint(eq10); (2*U+R0^3+2*R0*T-R0*S^2)/(-2*R0*S+3*R0^2+4*T-S^2) #Reality check: if the three P.i are equally spaced, what happens? > factor(subs({S=3*c,T=3*c^2,U=c^3},")); 1/3 R0 + 2/3 c #i.e., cos(phi)^2 = (1+2 cos(theta))/3. Here theta=0 means the three are #all in the same direction, so all must point north, so the angles phi with P0 #are zero too. Check. If the three P.i are equatorial, they're theta=120 #degrees apart from each other and phi=90 degrees away from P0. Check. #OK, I'm satisfied. :-) dave