Examples of normalize()


Examples of org.graphstream.ui.geom.Vector2.normalize()

        GraphicNode node1 = (GraphicNode) edge.getNode1();
        double off = evalEllipseRadius(edge, node0, node1, camera);
        Vector2 theDirection = new Vector2(node1.getX() - node0.getX(),
            node1.getY() - node0.getY());

        theDirection.normalize();

        double x = node1.x - (theDirection.data[0] * off);
        double y = node1.y - (theDirection.data[1] * off);
        Vector2 perp = new Vector2(theDirection.data[1],
            -theDirection.data[0]);
View Full Code Here

Examples of org.h2.tools.MultiDimension.normalize()

    }

    private void testHelperMethods() {
        MultiDimension m = MultiDimension.getInstance();
        assertEquals(Integer.MAX_VALUE, m.getMaxValue(2));
        assertEquals(0, m.normalize(2, 0, 0, 100));
        assertEquals(Integer.MAX_VALUE / 2, m.normalize(2, 50, 0, 100));
        assertEquals(Integer.MAX_VALUE, m.normalize(2, 100, 0, 100));
        assertEquals(Integer.MAX_VALUE / 10, m.normalize(2, 0.1, 0, 1));
        assertEquals(0, m.normalize(2, 1, 1, 1));
        assertEquals(0, m.normalize(2, 0, 0, 0));
View Full Code Here

Examples of org.integratedmodelling.riskwiz.pt.PT.normalize()

                PT.marginalizeDomainsFast(marginal, jtcluster.getPt(), mfmap);
                // MarginalizationDomainMap mfmap = cbundle.mfmap;
                // PT marginal = PT.marginalizeDomains(jtcluster.getPt(),
                // mfmap);
                marginal.normalize();
                node.setMarginal(marginal);
            }

        }
    }
View Full Code Here

Examples of org.jbox2d.common.Vec2.normalize()

            dc.getBody().applyForce(pAToShape,shapePos);
          }
        }else if(Vec2.dot(pBToShape, vecBToA)<0){
          if(pBToShape.lengthSquared()>ASBOTXConfigs.E_SQUARE){
            pBToShape.negateLocal();
            pBToShape.normalize();
            pBToShape.mulLocal(FORCE_MAGNITUDE);
            dc.getBody().applyForce(pBToShape,shapePos);
          }
        }else{
          dc.getBody().applyForce(Vec2.cross(pAToShape,vecAToB)>0?forces[0]:forces[1],shapePos);
View Full Code Here

Examples of org.jibx.schema.codegen.custom.GlobalExtension.normalize()

                for (int i = 0; i < count; i++) {
                    SchemaBase child = schema.getChild(i);
                    Object obj = child.getExtension();
                    if (obj instanceof GlobalExtension) {
                        GlobalExtension global = (GlobalExtension)obj;
                        global.normalize();
                        if (global.isRemoved()) {
                           
                            // just eliminate this definition from the schema
                            schema.detachChild(i);
                            instmod = true;
View Full Code Here

Examples of org.nlogo.api.Vect.normalize()

    Vect cors = new Vect(oxcor(), oycor(), ozcor());
    Vect up = forward.cross(right);
    Vect xaxis = new Vect(1, 0, 0);
    Vect upxy = new Vect(up.x(), up.y(), 0);
    upxy = upxy.normalize();

    if (up.z() > 0) {
      delta = -delta;
    }
View Full Code Here

Examples of org.olat.core.commons.services.text.impl.nutch.NGramProfile.normalize()

      case SIMILARITY:

        f = new File(filename);
        fis = new FileInputStream(f);
        newProfile = NGramProfile.create(filename, fis, encoding);
        newProfile.normalize();

        f = new File(filename2);
        fis = new FileInputStream(f);
        NGramProfile newProfile2 = NGramProfile.create(filename2, fis, encoding);
        newProfile2.normalize();
View Full Code Here

Examples of org.openmeetings.utils.geom.GeomPoint.normalize()

    double halfWidth = (arrowStyle.headWidth != -1) ? arrowStyle.headWidth/2 : arrowStyle.headLength/2;
   
    //Figure out the line start/end points
    GeomPoint startNorm = new GeomPoint();
    startNorm.setLocation(fullVect.getY(),-fullVect.getX());
    startNorm.normalize(arrowStyle.shaftThickness/2);
    GeomPoint start1 = start.add(startNorm);
    GeomPoint start2 = start.subtract(startNorm);
    GeomPoint end1 = end.add(startNorm);
    GeomPoint end2 = end.subtract(startNorm);
       
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ.normalize()

    VectorXYZ normal = new VectorXYZ(0, 0, 0);
    for (VectorXYZ addNormal : relevantNormals) {
      normal = normal.add(addNormal);
    }

    return normal.normalize();

  }

  private static Map<VectorXYZ, List<TriangleXYZ>> calculateAdjacentTriangles(
      Collection<TriangleXYZ> triangles) {
View Full Code Here

Examples of org.osm2world.core.math.VectorXZ.normalize()

   
    if (inVector.equals(outVector)) { //TODO: allow for some small difference?
      cutVector = outVector.rightNormal();
    } else {
      cutVector = outVector.subtract(inVector);
      cutVector = cutVector.normalize();
    }
   
    //make sure that cutVector points to the right, which is equivalent to:
    //y component of the cross product (inVector x cutVector) is positive.
    //If this isn't the case, invert the cut vector.
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.