Package engine.geometry

Examples of engine.geometry.Line


        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.setX(point.getX() + x);
            point.setY(point.getY() + y);
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setX1(line.getX1() + x);
            line.setY1(line.getY1() + y);
            line.setX2(line.getX2() + x);
            line.setY2(line.getY2() + y);
        } else if (shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            rectangle.setX(rectangle.getX() + x);
            rectangle.setY(rectangle.getY() + y);
        } else if (shape instanceof Circle) {
View Full Code Here


        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.setX(point.getX() * x);
            point.setY(point.getY() * y);
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setX1(line.getX1() * x);
            line.setY1(line.getY1() * y);
            line.setX2(line.getX2() * x);
            line.setY2(line.getY2() * y);
        } else if (shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            rectangle.setX(rectangle.getX() * x);
            rectangle.setY(rectangle.getY() * y);
            rectangle.setWidth(rectangle.getWidth() * x);
 
View Full Code Here

    public static void shear(final Shape shape, final double x, final double y) {
        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.set(point.getX() + x * point.getY(), point.getY() + y * point.getX());
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setStart(line.getX1() + x * line.getY1(), line.getY1() + y * line.getX1());
            line.setEnd(line.getX2() + x * line.getY2(), line.getY2() + y * line.getX2());
        } else if (shape instanceof Polygon) {
            Polygon polygon = (Polygon) shape;
            final int size = polygon.getSize();
            for (int i = 0; i < size; i++) {
                polygon.setVertex(i, polygon.getX(i) + x * polygon.getY(i), polygon.getY(i) + y * polygon.getX(i));
 
View Full Code Here

TOP

Related Classes of engine.geometry.Line

Copyright © 2018 www.massapicom. 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.