code: private double findAngle(final double fromX, final double fromY, final double toX, final double toY) {
          final double yDelta = toY - fromY;
          final double y = Math.sin(yDelta) * Math.cos(toX);
          final double x = Math.cos(fromX) * Math.sin(toX)
                  - Math.sin(fromX) * Math.cos(toX) * Math.cos(yDelta);
          double angle = Math.toDegrees(Math.atan2(y, x));
  
          // Keep a positive angle
          while (angle < 0) {
              angle += 360;
          }
          return (float) angle % 360;
      }
docs: Return the right angle for the given coordinate.
  
  @param fromX the x starting point coordinate
  @param toX the x arrival point coordinate
  @param fromY the y starting point coordinate
  @param toY the y arrival point coordinate
  
  @return the right angle