Package com.szuppe.jakub.common

Examples of com.szuppe.jakub.common.Line2D.intersectionPoint()


      final Coordinates2D paddleLeftTopCo = verticesList.get(1).moveAlongVector(
          new Coordinates2D(0, radius));
      final Coordinates2D paddleRightTopCo = verticesList.get(2).moveAlongVector(
          new Coordinates2D(0, radius));
      Line2D paddleTop = new Line2D(paddleLeftTopCo, paddleRightTopCo);
      Coordinates2D pointOfIntersection = paddleTop
          .intersectionPoint(ballMovementRay);
      double distance = Math.sqrt(Math.pow(
          pointOfIntersection.getX() - ball.getX(), 2)
          + Math.pow(pointOfIntersection.getY() - ball.getY(), 2));
      long timeTillCollision = (long) (distance / ballSpeed.getSpeedValue());
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.