Examples of norm()


Examples of eas.math.geometry.Vector2D.norm()

                                     Vector2D.NULL_VECTOR);
           
        } else {
            Vector2D vv = new Vector2D(x2, y2);
            vv.sub(new Vector2D(x1, y1));
            vv.norm();
            vv.mult(35);
           
            x1 += vv.x;
            y1 += vv.y;
            x2 -= vv.x;
View Full Code Here

Examples of eas.math.geometry.Vector2D.norm()

            return null;
        }
        angle = new Double(angle / 180 * Math.PI);
        vec = new Vector2D(0, 1);
        vec.rotate(Vector2D.NULL_VECTOR, angle);
        vec.norm();
        return vec;
    }
   
    /**
     * @param agent  Some agent in the environment.
View Full Code Here

Examples of jinngine.math.Vector3.norm()

    }

    @Test
    public void testNorm() {
        final Vector3 a = new Vector3(1., 2., 3.);
        a.norm();
        assertEquals(1., a.x);
        assertEquals(2., a.y);
        assertEquals(3., a.z);
        assertEquals(Math.sqrt(1029.), new Vector3(32., 1., 2.).norm());
        assertEquals(Math.sqrt(1029.), new Vector3(2., 32., 1.).norm());
View Full Code Here

Examples of jinngine.math.Vector3.norm()

    double lambda = raycast.run(s1, null, point, direction, new Vector3(), new Vector3(), 0, envelope, epsilon, false );
   
    // calculate the  point
    Vector3 p = point.add(direction.multiply(lambda));
   
    System.out.println("p norm="+p.norm());
   
    // the hitpoint must be within the envelope
    assertTrue( Math.abs(p.norm()-1) < envelope+epsilon);
   
    // move the sphere a bit downwards
View Full Code Here

Examples of jinngine.math.Vector3.norm()

    Vector3 p = point.add(direction.multiply(lambda));
   
    System.out.println("p norm="+p.norm());
   
    // the hitpoint must be within the envelope
    assertTrue( Math.abs(p.norm()-1) < envelope+epsilon);
   
    // move the sphere a bit downwards
    b1.setPosition(0,-envelope-2*epsilon, 0);
   
    // do the raycast
View Full Code Here

Examples of jinngine.math.Vector3.norm()

      Matrix3.multiply(ga.getBody().state.rotation, gadisp, gadisp);
      Matrix3.multiply(gb.getBody().state.rotation, gbdisp, gbdisp);
      Vector3 direction = ga.getBody().getPosition().add(gadisp).sub(gb.getBody().getPosition().add(gbdisp));
     
      // if direction is too small select a default one
      if (direction.norm() < epsilon)
        direction.assign(0,1,0);

      // compute the largest possible starting lambda, based on
      // the support of A-B along the ray direction
      Vector3 sp = Sa.supportPoint(direction.negate()).sub(Sb.supportPoint(direction));
View Full Code Here

Examples of jinngine.math.Vector3.norm()

    //calculate the equilibrium length
    Vector3 paw = a.toWorld(pa);   
    Vector3 pbw = b.toWorld(pb);   
    Vector3 x = paw.sub(pbw);
    this.equilibrium = x.norm();   
  }
 
  /**
   * Create a spring force with the given parameters
   * @param a
View Full Code Here

Examples of jinngine.math.Vector3.norm()

    //calculate the equilibrium length
    Vector3 paw = a.toWorld(pa);   
    Vector3 pbw = b.toWorld(pb);   
    Vector3 x = paw.sub(pbw);
    this.equilibrium = x.norm();   
   
  }
 
  public SpringForce(Body a, Vector3 pa,  Body b, Vector3 pb, double equilibrilium ) {   
    this.a = a;
View Full Code Here

Examples of jinngine.math.Vector3.norm()

//    Vector3 posError = b1.state.rCm.add(b1.state.q.rotate(p1)).minus(b2.state.rCm).minus(b2.state.q.rotate(p2)).multiply(Kcor);
    Vector3 posError = b1.state.position.add(ri).sub(b2.state.position).sub(rj).multiply(1.0/dt);
   
    // correction velocity limit
    if ( posError.norm() > velocitylimit) {
      posError.assign( posError.normalize().multiply(velocitylimit));
    }
   
    u.assign( u.add(posError));
   
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix.norm()

                Matrix B = Matrices.random(A.numRows(), A.numColumns());
                Matrix X = Matrices.random(A.numRows(), A.numColumns());
                X = A.solve(B, X);

                Matrix Y = A.multAdd(X, X.copy().set(-1, B));
                assertEquals(0, Y.norm(Matrix.Norm.Frobenius), tol);
                assertEquals(Ad, A);
                return;
            } catch (MatrixSingularException e) {
                Utilities.addDiagonal(A, Ad, 1);
            } catch (MatrixNotSPDException e) {
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.