code: static Point2d intersection(final Tuple2d p1, final Tuple2d d1, final Tuple2d p2, final Tuple2d d2) {
          final Vector2d p1End = sum(p1, d1);
          final Vector2d p2End = sum(p2, d2);
          return intersection(p1.x, p1.y, p1End.x, p1End.y, p2.x, p2.y, p2End.x, p2End.y);
      }
docs: Calculate the intersection of two vectors given their starting positions.
  
  @param p1 position vector 1
  @param d1 direction vector 1
  @param p2 position vector 2
  @param d2 direction vector 2
  @return the intersection