Examples of roots()


Examples of ca.eandb.jmist.math.Polynomial.roots()

    Polynomial f = new Polynomial(
        x0 * x0 - y0 * y0 + z0 * z0,
        2.0 * (x0 * x1 - y0 * y1 + z0 * z1),
        x1 * x1 - y1 * y1 + z1 * z1);

    double[] t = f.roots();

    if (t.length == 2) {
      for (int i = 0; i < 2; i++) {
        if (recorder.interval().contains(t[i])) {
          Point3 p = ray.pointAt(t[i]);
View Full Code Here

Examples of ca.eandb.jmist.math.Polynomial.roots()

    Polynomial f = new Polynomial(
        x0 * x0 - y0 * y0 + z0 * z0,
        2.0 * (x0 * x1 - y0 * y1 + z0 * z1),
        x1 * x1 - y1 * y1 + z1 * z1);

    double[] t = f.roots();

    if (t.length == 2) {
      for (int i = 0; i < 2; i++) {
        if (recorder.interval().contains(t[i])) {
          Point3 p = ray.pointAt(t[i]);
View Full Code Here

Examples of ca.eandb.jmist.math.Polynomial.roots()

              2.0 * s2NormOfDir * (s2NormOfOrig - (sqRadius1 + sqRadius2)) + 4.0 * ((dirDotOrig * dirDotOrig) + sqRadius1 * dir.y() * dir.y()),
              4.0 * dirDotOrig * s2NormOfDir,
              s2NormOfDir * s2NormOfDir
          );

    double[]  x = f.roots();

    if (x.length > 1)
    {
      Arrays.sort(x);
      for (int i = 0; i < x.length; i++)
View Full Code Here

Examples of ca.eandb.jmist.math.Polynomial.roots()

    Polynomial  f    = new Polynomial(
                orig.x() * orig.x() + orig.z() * orig.z() - this.radius * this.radius,
                2.0 * (orig.x() * dir.x() + orig.z() * dir.z()),
                dir.x() * dir.x() + dir.z() * dir.z()
              );
    double[]  x    = f.roots();

    if (x.length == 2)
    {
      // for each solution, make sure the point lies between the base and the apex
      p = ray.pointAt(x[0]);
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

            return cp.roots(new Complex(estx, 0.0));
        }

        public Complex[] roots(Complex estx){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots(estx);
        }

        // Calculate the roots (real or complex) of a polynomial (real or complex)
        public Complex[] roots(boolean polish, double estx){
            ComplexPoly cp = new ComplexPoly(this);
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

        }

        // Calculate the roots (real or complex) of a polynomial (real or complex)
        public Complex[] roots(boolean polish, double estx){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots(new Complex(estx, 0.0));
        }

        // ROOTS OF A QUADRATIC EQUATION
        // ax^2 + bx + c = 0
        // roots returned in root[]
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

        // Calculate the roots (real or double) of a polynomial (real or double)
        // polish = true ([for deg>3 see laguerreAll(...)]
        // initial root estimates are all zero [for deg>3 see laguerreAll(...)]
        public Complex[] roots(){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots();
        }

        // Calculate the roots - as above with the exception that the error messages are suppressed
        // Required by BlackBox
        public Complex[] rootsNoMessages(){
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

        // Calculate the roots (real or double) of a polynomial (real or double)
        // initial root estimates are all zero [for deg>3 see laguerreAll(...)]
        // for polish  see laguerreAll(...)[for deg>3]
        public Complex[] roots(boolean polish){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots(polish);
        }

        // Calculate the roots (real or double) of a polynomial (real or double)
        // for estx  see laguerreAll(...)[for deg>3] - initial estimate of first root
        // polish = true  see laguerreAll(...)[for deg>3]
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

        // Calculate the roots (real or double) of a polynomial (real or double)
        // for estx  see laguerreAll(...)[for deg>3] - initial estimate of first root
        // polish = true  see laguerreAll(...)[for deg>3]
        public Complex[] roots(double estx){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots(new Complex(estx, 0.0));
        }

        public Complex[] roots(Complex estx){
            ComplexPoly cp = new ComplexPoly(this);
            return cp.roots(estx);
View Full Code Here

Examples of flanagan.complex.ComplexPoly.roots()

                                break;
                        case 4: temp = RealRoot.cubic(coeffWz[0],coeffWz[1],coeffWz[2], coeffWz[3]);
                                if(((String)temp.get(0)).equals("complex"))realRoots = false;
                                break;
                        default: ComplexPoly cp = new ComplexPoly(coeffWz);
                                Complex[] croots = cp.roots(polish, new Complex(estx, 0.0));
                                cdreal = new double[nCoeffWz-1];
                                int counter = 0;
                                for(int i=0; i<(nCoeffWz-1); i++){
                                    if(croots[i].getImag()/croots[i].getReal()<RealRoot.realTol){
                                        cdreal[i] = croots[i].getReal();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.