edu.princeton.plot
Class RayEdgeIntersection

java.lang.Object
  extended by edu.princeton.plot.RayEdgeIntersection

public class RayEdgeIntersection
extends java.lang.Object

TODO Put here a description of what this class does.

Author:
MosheKatzwer. Created Jul 1, 2013.

Constructor Summary
RayEdgeIntersection()
           
 
Method Summary
static Point getEdgeIntersection(Point e1, Point e2, Point f1, Point f2, double tol)
           
static Point getIntersection(Point o, Point d, Point e1, Point e2, double tol)
          Solves the system o + a * d = z * e1 + (1-z) * e2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RayEdgeIntersection

public RayEdgeIntersection()
Method Detail

getEdgeIntersection

public static Point getEdgeIntersection(Point e1,
                                        Point e2,
                                        Point f1,
                                        Point f2,
                                        double tol)

getIntersection

public static Point getIntersection(Point o,
                                    Point d,
                                    Point e1,
                                    Point e2,
                                    double tol)
Solves the system o + a * d = z * e1 + (1-z) * e2

Parameters:
o - origin of ray
d - direction of ray
e1 - vertex 1 of edge
e2 - vertex 2 of edge
tol - the method tolerance, what the method treats as "zero"
Returns:
[a, z]