¡@

Home 

java Programming Glossary: getintersectionpoint

Line crosses Rectangle - how to find the cross points?

http://stackoverflow.com/questions/15594424/line-crosses-rectangle-how-to-find-the-cross-points

rect g2d.draw line g2d.setColor Color.RED Point2D ps getIntersectionPoint line rect for Point2D p ps if p null g2d.fill new Ellipse2D.Double.. p.getX 4 p.getY 4 8 8 g2d.dispose public Point2D getIntersectionPoint Line2D line Rectangle2D rectangle Point2D p new Point2D 4 .. rectangle Point2D p new Point2D 4 Top line p 0 getIntersectionPoint line new Line2D.Double rectangle.getX rectangle.getY rectangle.getX..