Package com.dcaiti.eworld.visualizer.utilities

Examples of com.dcaiti.eworld.visualizer.utilities.Arrow


        || super.getModelElement().getDestinationLongitude() == 0
        || Double.isNaN(super.getModelElement().getDestinationLatitude())
        || Double.isNaN(super.getModelElement().getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLatitude(),
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLongitude(),
        super.getModelElement().getDestinationLatitude(), super.getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90)) * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90)) * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude, destinationLongitude);
  }
View Full Code Here


            .getDestinationLatitude())
        || Double.isNaN(super.getModelElement()
            .getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(
            Point2DUtils.convertPoint(super.getModelElement()
                .getPosition())).getLatitude(),
        GlobalPosition.from(
            Point2DUtils.convertPoint(super.getModelElement()
                .getPosition())).getLongitude(), super
            .getModelElement().getDestinationLatitude(), super
            .getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] {
            super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] {
            super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90))
        * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90))
        * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude,
        destinationLongitude);
  }
View Full Code Here

        || super.getModelElement().getDestinationLongitude() == 0
        || Double.isNaN(super.getModelElement().getDestinationLatitude())
        || Double.isNaN(super.getModelElement().getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLatitude(),
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLongitude(),
        super.getModelElement().getDestinationLatitude(), super.getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90)) * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90)) * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude, destinationLongitude);
  }
View Full Code Here

TOP

Related Classes of com.dcaiti.eworld.visualizer.utilities.Arrow

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.