def intersection(other)
	    return self.first if (self.first == other.first) or (self.first == other.last)
	    return self.last if (self.last == other.first) or (self.last == other.last)

	    p0, p1 = self.first, self.last
	    p2, p3 = other.first, other.last
	    v1, v2 = self.vector, other.vector

	    denominator = v1[0] * v2[1] - v2[0] * v1[1]		# v1 x v2
	    p = p0 - p2
	    if denominator == 0	    # collinear, so check for overlap
		if 0 == (-v1[1] * p.x + v1[0] * p.y)	# collinear?
		    # The edges are collinear, but do they overlap?
		    # Project them onto the x and y axes to find out
		    left1, right1 = [self.first[0], self.last[0]].sort
		    bottom1, top1 = [self.first[1], self.last[1]].sort
		    left2, right2 = [other.first[0], other.last[0]].sort
		    bottom2, top2 = [other.first[1], other.last[1]].sort

		    !((left2 > right1) || (right2 < left1) || (top2 < bottom1) || (bottom2 > top1))
		else
		    nil
		end
	    else
		s = (-v1[1] * p.x + v1[0] * p.y).to_r / denominator	# v1 x (p0 - p2) / denominator
		t = ( v2[0] * p.y - v2[1] * p.x).to_r / denominator	# v2 x (p0 - p2) / denominator

		p0 + v1 * t if ((0..1) === s) && ((0..1) === t)
	    end
	end
def intersection(other)
	    return self.first if (self.first == other.first) or (self.first == other.last)
	    return self.last if (self.last == other.first) or (self.last == other.last)

	    p0, p1 = self.first, self.last
	    p2, p3 = other.first, other.last
	    v1, v2 = self.vector, other.vector

	    denominator = v1[0] * v2[1] - v2[0] * v1[1]		# v1 x v2
	    p = p0 - p2
	    if denominator == 0	    # collinear, so check for overlap
		if 0 == (-v1[1] * p.x + v1[0] * p.y)	# collinear?
		    # The edges are collinear, but do they overlap?
		    # Project them onto the x and y axes to find out
		    left1, right1 = [self.first[0], self.last[0]].sort
		    bottom1, top1 = [self.first[1], self.last[1]].sort
		    left2, right2 = [other.first[0], other.last[0]].sort
		    bottom2, top2 = [other.first[1], other.last[1]].sort

		    !((left2 > right1) || (right2 < left1) || (top2 < bottom1) || (bottom2 > top1))
		else
		    nil
		end
	    else
		s = (-v1[1] * p.x + v1[0] * p.y).to_r / denominator	# v1 x (p0 - p2) / denominator
		t = ( v2[0] * p.y - v2[1] * p.x).to_r / denominator	# v2 x (p0 - p2) / denominator

		p0 + v1 * t if ((0..1) === s) && ((0..1) === t)
	    end
	end
Find the intersection of two {Edge}s (http://bloggingmath.wordpress.com/2009/05/29/line-segment-intersection/)
 @param [Edge] other	The other {Edge}
 @return [Point] The intersection of the two {Edge}s, nil if they don't intersect, true if they're collinear and overlapping, and false if they're collinear and non-overlapping