python - cosd and sind with sympy -
there seems no equivalent cosd
, sind
in sympy (ie cosine , sine arguments in degrees). there simple way implement functions ?
for numpy, did :
numpy.cosd = lambda x : numpy.cos( numpy.deg2rad(x) )
something :
sympy.cosd = lambda x : sympy.cos( sympy.pi/180*x )
works evaluation, expression printed :
cos(pi*x/180)
which not great readability (i have complicated expression due 3d coordinates changes). there way create sympy.cosd
function evaluates cos(pi/180 * x)
prints cosd(x)
?
sympy
have radian converter, in mpmath
module.
sympy.cosd = lambda x : sympy.cos( sympy.mpmath.radians(x) )
Comments
Post a Comment