Skip to content

Commit

Permalink
src/sage/geometry/cone.py: update a max_angle() test
Browse files Browse the repository at this point in the history
Maxima no longer crashes, so the description was wrong, and we can
avoid numerical comparisons with simplify() and a round trip through
sympy.
  • Loading branch information
orlitzky committed Apr 24, 2024
1 parent f9a4e32 commit 66eba0e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/sage/geometry/cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -6296,16 +6296,19 @@ def max_angle(self, other=None, exact=True, epsilon=0):
sage: bool(K.max_angle()[0] == ((n-1)/n)*pi)
True
We check the numerical values for the next two, because
otherwise Maxima crashes for some unknown reason::
Sage can't prove that the actual and expected results are
equal in the next two cases without a little nudge in the
right direction::
sage: n = 4
sage: K = cones.schur(n)
sage: bool(K.max_angle()[0].n() == (((n-1)/n)*pi).n())
sage: bool( K.max_angle()[0].simplify() == ((n-1)/n)*pi )
True
sage: n = 5
sage: K = cones.schur(n)
sage: bool(K.max_angle()[0].n() == (((n-1)/n)*pi).n())
sage: actual = K.max_angle()[0].simplify()._sympy_()._sage_()
sage: expected = ((n-1)/n)*pi
sage: bool( actual == expected )
True
When there's a unit norm vector in ``self`` whose negation is
Expand Down

0 comments on commit 66eba0e

Please sign in to comment.