From: m9305474@student.anu.edu.au (John McLaughlin) Newsgroups: sci.math Subject: obtuse geometry question Date: Sat, 29 Apr 1995 11:16:23 +1000 Hi, I need to solve a triangle problem in obtuse geometry (for a program algorithm). It is as follows: p2 / \ b / \ a / \ / \ / \ p1----------p3 c p1, p2 and p3 lie on the unit sphere. The angles between the points are a,b and c as indicated. The problem is, given a, b, c, p1 and p2 how do I find p3 = ( 1, theta3, phi3 ) (in spherical coords) ? Presumably there is some quadratic solution giving two values for p3. That's ok. Any email replies would really be appreciated. I will post the solution. -John McLaughlin ============================================================================== From: rusin@washington.math.niu.edu (Dave Rusin) Newsgroups: sci.math Subject: Re: obtuse geometry question Date: 4 May 1995 15:16:12 GMT In article , John McLaughlin wrote: > p2 > / \ > b / \ a > / \ > / \ > / \ > p1----------p3 > c > >p1, p2 and p3 lie on the unit sphere. >The angles between the points are a,b and c as indicated. >The problem is, given a, b, c, p1 and p2 how do I find >p3 = ( 1, theta3, phi3 ) (in spherical coords) ? Let's use an orthonormal basis in which we write p1=e1 p2=z e1 + y e2 p3=w e1 + v e2 + u e3 Then the conditions given imply (using dot products) cos(b)=z cos(c)=w cos(a)=zw+yv and since the p_i are on the unit sphere, we have lengths=1: z^2+y^2=1 w^2+v^2+u^2=1 That's five equations in 5 unknowns, whose solution is z=cos(b) y=+-sin(b) [we can replace e2 by -e2 to assume y=sin(b)] w=cos(c) v=[cos(a)-cos(b)cos(c)]/sin(b) u=+-sqrt(sin^2(c)-v^2) Actually, you could use these to _define_ e2 as (p2 - cos(b) p1)/sin(b). Then you can compute e3 = e1 X e2 (or its negative, e2 X e1; different choices will lead to the two possible points p3 meeting the conditions of your problem -- the ones on either side of the arc p1 p2). So one solution to your problem is to compute w, v, u as above, and compute e2 and e3 as indicated, then deduce p3=w e1 + v e2 + u e3 (computed in cartesian coordinates). If I've made the right substitutions, this makes p3 be 1/[sin(b)]^2 times the following vector: [cos(c)-cos(b)cos(a)] p1 + + [cos(a)-cos(b)cos(c)] p2 + +-sqrt[1-cos^2(a)-cos^2(b)-cos^2(c) + 2cos(a)cos(b)cos(c)] p1 X p2 You can then convert to spherical coordinates if you wish. dave