Package com.szuppe.jakub.common

Examples of com.szuppe.jakub.common.Line2D


      // TOP CHECK
      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

Related Classes of com.szuppe.jakub.common.Line2D

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.