Examples of distance()


Examples of java.awt.geom.Point2D.distance()

        u.startTimer();
        int transparent = new Color(0,0,0,0).getRGB();
        for(int x=0; x<width; x++) {
            for(int y=0; y<height; y++) {
                Point2D pt = new Point(x,y);
                if(pt.distance(c) > width/2 || pt.distance(c) < width/2-ringWidth) {
                    img.setRGB(x,y,transparent);
                } else {
                    double angle = GeomUtil.calcAngle(c, pt);
                    int color = Color.HSBtoRGB((float) (angle/360f),1,1);
                    img.setRGB(x,y,color);
View Full Code Here

Examples of javax.vecmath.Point2d.distance()

        // store the current stroke
        Stroke storedStroke = this.g.getStroke();
        this.g.setStroke(new BasicStroke(1));
       
        // calculate the distances between circles
        double distance = vertexB.distance(vertexA);
        double gapFactor = 0.1;
        double gap = distance * gapFactor;
        double numberOfCircles = distance*5;
       
        int diameter = (int)(rendererModel.getBondLength()*rendererModel.getZoomFactor()*1.2*gapFactor)+2;
 
View Full Code Here

Examples of javax.vecmath.Point3d.distance()

        triangle.getCoordinate(2, p3);

        // compute the triangle sides length
        double a = p1.distance(p2);
        double b = p2.distance(p3);
        double c = p3.distance(p1);

        // compute the semi perimeter
        double s = (a + b + c) / 2;

        // compute the area
View Full Code Here

Examples of javax.vecmath.Point3f.distance()

      // but if periodic, then the navigationCenter may have to be moved back a
      // notch
      Point3f pt = new Point3f(navigationCenter);
      viewer.toUnitCell(navigationCenter, null);
      // presuming here that pointT is still a molecular point??
      if (pt.distance(navigationCenter) > 0.01) {
        matrixTransform.transform(navigationCenter, pt);
        float dz = navigationShiftXY.z - pt.z;
        // the new navigation center determines the navigationZOffset
        modelCenterOffset += dz;
        calcCameraFactors();
View Full Code Here

Examples of jdepend.framework.JavaPackage.distance()

            getWriter().print(jPackage.getAbstractClassCount() + ",");
            getWriter().print(jPackage.afferentCoupling() + ",");
            getWriter().print(jPackage.efferentCoupling() + ",");
            getWriter().print(toFormattedString(jPackage.abstractness()) + ",");
            getWriter().print(toFormattedString(jPackage.instability()) + ",");
            getWriter().print(toFormattedString(jPackage.distance()) + ",");
            getWriter().println(jPackage.getVolatility());
        }
    }

    protected void printSectionBreak() {
View Full Code Here

Examples of megamek.common.Coords.distance()

                    continue;
                }

                int localdensity = mapSettings.getCityDensity();
                if (radius > 0) {
                    int distance = coord.distance(centre);
                    localdensity = (int) (mapSettings.getCityDensity() - (falloff
                            * distance * distance));
                }

                if (Compute.randomInt(100) > localdensity) {
View Full Code Here

Examples of micdoodle8.mods.galacticraft.api.vector.Vector3.distance()

        int mini = 0;

        for (int i = 2; i < colorwheelAngles.length - 2; i++)
        {
            Vector3 color = colorwheelColors[i];
            double separation = color.distance(rgb);
            if (separation < mindist)
            {
                mindist = separation;
                mini = i;
            }
View Full Code Here

Examples of net.phys2d.math.Vector2f.distance()

    if (rightPoint != null) {
      dis1 = rightPoint.distance(start) - norm.length();
    }
    float dis2 = Float.MAX_VALUE;
    if (leftPoint != null) {
      dis2 = leftPoint.distance(start) - norm.length();
    }
   
    norm.normalise();
    float dis = Math.min(dis1,dis2);
   
View Full Code Here

Examples of org.andrewberman.ui.Point.distance()

      PhyloTree pt = (PhyloTree) tree;
      PhyloNode h = pt.hoveredNode;
      if (h != null)
      {
        Point point = new Point(getX(h), getY(h));
        float dist = (float) point.distance(mousePt);
        float bulgedSize = BulgeUtil.bulge(dist, .7f, 30);
        if (textSize <= 12)
          h.zoomTextSize = bulgedSize;
        else
          h.zoomTextSize = 1f;
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line.distance()

    }

    @Test
    public void testPointDistance() throws MathIllegalArgumentException {
        Line l = new Line(new Vector3D(0, 1, 1), new Vector3D(0, 2, 2), 1.0e-10);
        Assert.assertEquals(FastMath.sqrt(3.0 / 2.0), l.distance(new Vector3D(1, 0, 1)), 1.0e-10);
        Assert.assertEquals(0, l.distance(new Vector3D(0, -4, -4)), 1.0e-10);
    }

    @Test
    public void testLineDistance() throws MathIllegalArgumentException {
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.