ITeye博客

algorithm

共 1 篇文章

二元二次 - 有待通用化为N元N次

function Formula(){ this.a = 0;this.b = 0;this.c = 0; this.toString=function(){ return this.a +","+this.b+","+this.c; }; this.getY=function(x){ return this.a*Math.pow(x,2)+this.b*x+this.c; }; this.getX=function(y,xRange){//x=[-b±√(b^2+4a(y-c))]/(2a) var sqrt_b2_4ac = Math.sqrt(Math.pow(this.b,2)+4*…

2009-06-18 09:17 · java · algorithm