Home :: Tutorials :: Geometry

  1. Introduction
  2. Reference
    1. Class Methods
      1. intersectShapes
      2. intersectPathShape
      3. intersectBezier2Bezier2
      4. intersectBezier2Bezier3
      5. intersectBezier2Circle
      6. intersectBezier2Ellipse
      7. intersectBezier2Line
      8. intersectBezier2Polygon
      9. intersectBezier2Rectangle
      10. intersectBezier3Bezier3
      11. intersectBezier3Circle
      12. intersectBezier3Ellipse
      13. intersectBezier3Line
      14. intersectBezier3Polygon
      15. intersectBezier3Rectangle
      16. intersectCircleCircle
      17. intersectCircleEllipse
      18. intersectCircleLine
      19. intersectCirclePolygon
      20. intersectCircleRectangle
      21. intersectEllipseEllipse
      22. intersectEllipseLine
      23. intersectEllipsePolygon
      24. intersectEllipseRectangle
      25. intersectLineLine
      26. intersectLinePolygon
      27. intersectLineRectangle
      28. intersectPolygonPolygon
      29. intersectPolygonRectangle
      30. intersectRectangleRectangle
      31. bezout
    2. Methods
      1. constructor
      2. init
      3. appendPoint
      4. appendPoints
    3. Properties
      1. status
      2. points
  3. Download


Intersection is a JavaScript object used to capture the results of the intersection of two Shape objects. Class methods perform the actual intersections and use only Point2D objects as parameters. This makes this class useful stand-alone uses where you don't want to use the 2D Geometry library.

The Ellipse-Ellipse intersection code is based on code written by David Eberly. That code and many more excellent examples are available at his site. If you are at all interested in 3D gaming algorithms, then I highly recommend his "3D Game Engine Design" book (ISBN 1-55860-593-2).

This code is used in the 2D Geometry section of this site.


Class Methods

intersectShapes(shape1, shape2) : Intersection;

intersectPathShape(path, shape) : Intersection;

intersectBezier2Bezier2(a1, a2, a3, b1, b2, b3) : Intersection;

intersectBezier2Bezier3(a1, a2, a3, b1, b2, b3, b4) : Intersection;

intersectBezier2Circle(p1, p2, p3, c, r) : Intersection;

intersectBezier2Ellipse(p1, p2, p3, ec, rx, ry) : Intersection;

intersectBezier2Line(p1, p2, p3, a1, a2) : Intersection;

intersectBezier2Polygon(p1, p2, p3, points) : Intersection;

intersectBezier2Rectangle(p1, p2, p3, r1, r2) : Intersection;

intersectBezier3Bezier3(a1, a2, a3, a4, b1, b2, b3, b4) : Intersection;

intersectBezier3Circle(p1, p2, p3, p4, c, r) : Intersection;

intersectBezier3Ellipse(p1, p2, p3, p4, ec, rx, ry) : Intersection;

intersectBezier3Line(p1, p2, p3, p4, a1, a2) : Intersection;

intersectBezier3Polygon(p1, p2, p3, p4, points) : Intersection;

intersectBezier3Rectangle(p1, p2, p3, p4, r1, r2) : Intersection;

intersectCircleCircle(c1, r1, c2, r2) : Intersection;

intersectCircleEllipse(cc, r, ec, rx, ry) : Intersection;

intersectCircleLine(c, r, a1, a2) : Intersection;

intersectCirclePolygon(c, r, points) : Intersection;

intersectCircleRectangle(c, r, r1, r2) : Intersection;

intersectEllipseEllipse(c1, rx1, ry1, c2, rx2, ry2) : Intersection;

intersectEllipseLine(c, rx, ry, a1, a2) : Intersection;

intersectEllipsePolygon(c, rx, ry, points) : Intersection;

intersectEllipseRectangle(c, rx, ry, r1, r2) : Intersection;

intersectLineLine(a1, a2, b1, b2) : Intersection;

intersectLinePolygon(a1, a2, points) : Intersection;

intersectLineRectangle(a1, a2, r1, r2) : Intersection;

intersectPolygonPolygon(points1, points2) : Intersection;

intersectPolygonRectangle(points, r1, r2) : Intersection;

intersectRectangleRectangle(a1, a2, b1, b2) : Intersection;

bezout(e1, e2) : Polynomial;


constructor - new Intersection(status);






Intersection.js - the Intersection object only

2D.js.gz - all objects needed to use this object and other 2D geometry objects