Package java.awt.geom

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


                field.virtualXMin() + location.getX() * field.virtualWidth,
                field.virtualYMin() + location.getY() * field.virtualHeight);
        for (int i = 0; i < field.height; i++) {
            for (int j = 0; j < field.width; j++) {
                Point2D p = new Point2D.Double(field.virtualX(j), field.virtualY(i));
                double distance = p.distance(virtualP);

                field.values[i][j] += waveFunc(distance);
            }
        }
    }
View Full Code Here


            return; // we never started a selection
        }
        Point pt = e.getPoint();
        Point2D pt2 = ShapeUtils.getPointInRectangle(pt.x, pt.y,
                panel.getScreenDataArea());
        if (pt2.distance(this.lastPoint) > 5) {
            this.selectionPath.lineTo(pt2.getX(), pt2.getY());
            this.lastPoint = pt2;
        }
        panel.setSelectionShape(selectionPath);
        panel.setSelectionFillPaint(this.fillPaint);
View Full Code Here

            return; // we never started a selection
        }
        Point pt = e.getPoint();
        Point2D pt2 = ShapeUtils.getPointInRectangle(pt.x, pt.y,
                panel.getScreenDataArea());
        if (pt2.distance(this.lastPoint) > 5) {
            this.points.add(new Point((int)pt2.getX(), (int)pt2.getY()));
            this.lastPoint = pt2;
        }
       
        selectionPath = createPathFromPoints(this.points);
View Full Code Here

            if (paint instanceof RadialGradientPaint) {
                RadialGradientPaint rgp = (RadialGradientPaint) paint;
                Point2D center = rgp.getCenterPoint();
                Point2D focus = rgp.getFocusPoint();          
                double focusDistance = focus.distance(center);
                double focusAngle = 0.0;
                if (!focus.equals(center)) {
                    focusAngle = Math.atan2(focus.getY() - center.getY(),
                        focus.getX() - center.getX());
                }
View Full Code Here

        Point2D lastPoint = dest;
        Point2D newestPoint = justBeforeDestination;

        // Check that this ray subpath is long enough to be considered
        if (newestPoint.distance(lastPoint) < 0.01 && type != RayData.RayType.ORIGIN) {
          pathBroken = true;
        }

        // Subpath must be double-direct if from diffraction
        if (type == RayData.RayType.DIFFRACTION && !isDirectPath(lastPoint, newestPoint)) {
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.