| 1 | initial version |
The problem comes from the fact that Sage does not know that its own abs should be translated into sympy.Abs (see the upper case). This has been fixed in trac ticket 15057, and merged today in Sage 6.4.beta3. Your options are:
absFor this, just add the following before your code:
sage: import sympy
sympy.abs = sympy.Abs
In you last line, you will get (i did not check it it the expected result though):
sage: sympy.sympify(d)
-sqrt(Abs(-h + s*sin(theta))**2 + Abs(r - s*cos(theta))**2) + sqrt(Abs(-h*sin(phi) + r*cos(phi) - s*cos(theta))**2 + Abs(-h*cos(phi) - r*sin(phi) + s*sin(theta))**2)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.