newton数学api的python 3包装器
pynewtonmath的Python项目详细描述
基本知识
pynewtonmath是一个python 3.x api包装器,为 newton micro-service,即available on GitHub。
牛顿做任何事,从数值计算到符号数学 正在分析。
安装
使用pip:
pip install pynewtonmath
来自github:
pip install git+https://github.com/benpryke/pynewtonmath
用法
importpynewtonmathasnewtonnewton.derive('x^2')# -> '2 x'newton.cos('pi')# -> -1newton.zeroes('x^2+2x')# -> [-2, 0]
- 不需要实例化
- 支持自然回报类型
为了方便起见,以下方法采用可选的额外参数。作为 根据API,如果未指定这些值,则必须在 牛顿表达式中的水平条'|'。
newton.log('2|8')# -> 3newton.log(8,base=2)# -> 3newton.tangent('2|x^3')# -> '12 x + -16'newton.tangent('x^3',x=2)# -> '12 x + -16'newton.area('2:4|x^3')# -> 60newton.area('x^3',start=2,end=4)# -> 60
有关终结点的完整列表,请参见the newton API GitHub repo。