Numerical approximation of symbolic equation
What I would like to do is the following:
sage: var('theta') theta sage: theta=25*units.angles.degree sage: print theta 25*degree sage: a=sin(theta) sage: print a sin(25*degree)
At this point, I type 'a.' and tab and in the popup list of functions I find numerical_approx. So I type in:
sage: a.numerical_approx() Traceback (click to the left of this block for traceback) ... TypeError: cannot evaluate symbolic expression numerically
Okay, it would appear that adding the units to theta turns it into a symbolic variable which turns my expression a into a symbolic expression. But what I would like to do is enter my angle theta in either degrees or radians and get a numerical approximation of the answer based on the units of the input. Is there a clean way to do this?