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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -