我想要一个好的科学计算器,只需输入二次方程就可以计算出任何二次方程的根
首先,有没有类似 ubuntu 软件中心的应用程序?
答案1
在 中非常简单octave
,只需将方程的系数输入roots
函数中即可
octave:1> roots([1,0,-1])
ans =
-1
1
参阅在线帮助
octave:2> help roots
'roots' is a function from the file /usr/share/octave/3.8.1/m/polynomial/roots.m
-- Function File: roots (V)
For a vector V with N components, return the roots of the
polynomial
v(1) * z^(N-1) + ... + v(N-1) * z + v(N)
As an example, the following code finds the roots of the quadratic
polynomial
p(x) = x^2 - 5.
c = [1, 0, -5];
roots (c)
=> 2.2361
=> -2.2361
Note that the true result is +/- sqrt(5) which is roughly +/-
2.2361.
See also: poly, compan, fzero.
答案2
算一下!可能符合您的需求: