Package javax.vecmath

Examples of javax.vecmath.GVector.sub()


        GVector x = new GVector( initialGuess );
        GVector tempv = new GVector( initialGuess );
        tempv.mul( matrix, initialGuess );
        GVector bb = new GVector( b );
        bb.sub( tempv );
        GVector r = new GVector( bb );
        GVector p = new GVector( r );
        GVector xnew = new GVector( p );
        GVector rnew = new GVector( p );
        GVector pnew = new GVector( p );
View Full Code Here


    if (clamp(ua, 0f, 1f) != ua || clamp(ub, 0f, 1f) != ub)
      return null;
    GVector v=new GVector(new double[] {a.A.getPosition().x,a.A.getPosition().y});
    GVector d=new GVector(new double[] {a.B.getPosition().x,a.B.getPosition().y});
    d.sub(v);
    d.scale(ua);
    d.add(v);
    return new Coordinate(d.getElement(0),d.getElement(1));   
  }
 
View Full Code Here

      float closestDot = -1f;
      for (int count=0;count<interiorReflexVertices.size();count++)
      {
        Vertex v=(Vertex)interiorReflexVertices.get(count);
        GVector n=new GVector(new double[] {v.getPosition().x,v.getPosition().y});
        n.sub(new GVector(new double[] {rightMostHoleVertex.getPosition().x,rightMostHoleVertex.getPosition().y}));
        n.normalize();
        GVector m=new GVector(new double[] {1.0,0.0});
        float dot=(float)m.dot(n);
       
View Full Code Here

    Vertex n = (Vertex)polygonVertices.get(polygonVertices.indexOf(c) + 1);
    Coordinate cc=c.getPosition();
    Coordinate pc=p.getPosition();
    Coordinate nc=n.getPosition();
    GVector d1=new GVector(new double[] {cc.x,cc.y});
    d1.sub(new GVector(new double[] {pc.x,pc.y}));
    d1.normalize();
   
    GVector d2=new GVector(new double[] {nc.x,nc.y});
    d2.sub(new GVector(new double[] {cc.x,cc.y}));
    d2.normalize();
View Full Code Here

    GVector d1=new GVector(new double[] {cc.x,cc.y});
    d1.sub(new GVector(new double[] {pc.x,pc.y}));
    d1.normalize();
   
    GVector d2=new GVector(new double[] {nc.x,nc.y});
    d2.sub(new GVector(new double[] {cc.x,cc.y}));
    d2.normalize();
   
   
    GVector n2=new GVector(new double[] {-d2.getElement(1),d2.getElement(0)});
    return d1.dot(n2)<=0.0;
View Full Code Here

    for (int i = 1; i < vertices.getNumPoints(); i++)
    {
      Coordinate p2 = vertices.getCoordinateN(i);
      Coordinate p3 = vertices.getCoordinateN((i + 1) % vertices.getNumPoints());
      GVector e1=new GVector(new double[] {p1.x,p1.y});
      e1.sub(new GVector(new double[] {p2.x,p2.y}));
      GVector e2=new GVector(new double[] {p3.x,p3.y});
      e2.sub(new GVector(new double[] {p2.x,p2.y}));
     

      if (e1.getElement(0)* e2.getElement(1) - e1.getElement(1) * e2.getElement(0) >= 0)
View Full Code Here

      Coordinate p2 = vertices.getCoordinateN(i);
      Coordinate p3 = vertices.getCoordinateN((i + 1) % vertices.getNumPoints());
      GVector e1=new GVector(new double[] {p1.x,p1.y});
      e1.sub(new GVector(new double[] {p2.x,p2.y}));
      GVector e2=new GVector(new double[] {p3.x,p3.y});
      e2.sub(new GVector(new double[] {p2.x,p2.y}));
     

      if (e1.getElement(0)* e2.getElement(1) - e1.getElement(1) * e2.getElement(0) >= 0)
        clockWiseCount++;
      else
View Full Code Here

    if (clamp(ua, 0f, 1f) != ua || clamp(ub, 0f, 1f) != ub)
      return null;
    GVector v=new GVector(new double[] {a.A.getPosition().x,a.A.getPosition().y});
    GVector d=new GVector(new double[] {a.B.getPosition().x,a.B.getPosition().y});
    d.sub(v);
    d.scale(ua);
    d.add(v);
    return new Coordinate(d.getElement(0),d.getElement(1));   
  }
 
View Full Code Here

      float closestDot = -1f;
      for (int count=0;count<interiorReflexVertices.size();count++)
      {
        Vertex v=(Vertex)interiorReflexVertices.get(count);
        GVector n=new GVector(new double[] {v.getPosition().x,v.getPosition().y});
        n.sub(new GVector(new double[] {rightMostHoleVertex.getPosition().x,rightMostHoleVertex.getPosition().y}));
        n.normalize();
        GVector m=new GVector(new double[] {1.0,0.0});
        float dot=(float)m.dot(n);
       
View Full Code Here

    Vertex n = (Vertex)polygonVertices.get(polygonVertices.indexOf(c) + 1);
    Coordinate cc=c.getPosition();
    Coordinate pc=p.getPosition();
    Coordinate nc=n.getPosition();
    GVector d1=new GVector(new double[] {cc.x,cc.y});
    d1.sub(new GVector(new double[] {pc.x,pc.y}));
    d1.normalize();
   
    GVector d2=new GVector(new double[] {nc.x,nc.y});
    d2.sub(new GVector(new double[] {cc.x,cc.y}));
    d2.normalize();
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.