Laws of trigonometry 2

3371 days ago by Kris.Coolsaet

We retake the example of Laws of trigonometry 1 but with a different lexical ordering.

R = PolynomialRing (QQ, 'a,A,b,B,c,C', order='lex') a,A,b,B,c,C = R.gens() coslawa = (1+A^2)*(b^2+c^2-a^2) - 2*b*c*(1-A^2) coslawb = (1+B^2)*(c^2+a^2-b^2) - 2*c*a*(1-B^2) coslawc = (1+C^2)*(a^2+b^2-c^2) - 2*a*b*(1-C^2) Icos = Ideal (coslawa,coslawb,coslawc) Gcos = Icos.groebner_basis('libsingular:std') len (Gcos) 
       

                                
                            

                                
Gcos[-1].factor() 
       

                                
                            

                                

And voilà, we immediately find the result we were looking for: the law of sines and an expression that looks very much like it. I.e.,  $\frac{\sin \beta}b = \frac{\sin \gamma}c$ or  $\frac{\sin \beta}b = - \frac{\sin \gamma}c$.

The additional rule is not very surprising, because the cosine laws cannot distinguish between an angle and its negative as their cosines remain the same.

Finally, we compute a Gröbner basis using total degree ordering degrevlex (the default)

R = PolynomialRing (QQ, 'a,A,b,B,c,C', order='degrevlex') a,A,b,B,c,C = R.gens() 
       

Note that the monomial ordering is indeed different:

(a+b+1)^2 
       

                                
                            

                                

The higher degree terms are now in front.

The resulting Gröbner basis is now shorter than in the lexicographical case:

coslawa = (1+A^2)*(b^2+c^2-a^2) - 2*b*c*(1-A^2) coslawb = (1+B^2)*(c^2+a^2-b^2) - 2*c*a*(1-B^2) coslawc = (1+C^2)*(a^2+b^2-c^2) - 2*a*b*(1-C^2) Icos = Ideal (coslawa,coslawb,coslawc) Gcos = Icos.groebner_basis('libsingular:std') len (Gcos) 
       

                                
                            

                                

The resulting basis is now ordered by degree.

[f.degree() for f in Gcos] 
       

                                
                            

                                

The last three basis elements are essentially the original laws of cosine.

Gcos[-3:] 
       

                                
                            

                                

However. This time it is not so easy to find a 'useful' and 'elegant' formula among the basis elements.

 

We have better luck if we add the requirement $\alpha+\beta+\gamma=\pi$:

sumofangles = A*B + B*C + C*A - 1 Icos = Ideal (coslawa,coslawb,coslawc,sumofangles) Gcos = Icos.groebner_basis('libsingular:std') len (Gcos) 
       

                                
                            

                                
Gcos[-4].factor() 
       

                                
                            

                                

This translates to \[\frac{\cot\alpha}{-a+b+c} = \frac{\cot{\gamma}}{a+b-c}\] which is the less known law of cotangents