public override SegmentCollisionResult CollideLineSegment(ShapeLineSegment other) { //We can just do a line-line intersection, as if both Segments are Lines, //and then see if the point of intersection //is on both segments. No need for ridiculous math here! ShapeLine one = ToLine(); ShapeLine two = other.ToLine(); LineCollisionResult res = one.CollideLines(two); if(res.Collides && PointLiesOnSegment(res.PointOfIntersection) && other.PointLiesOnSegment(res.PointOfIntersection)) { return new SegmentCollisionResult {Collides = true, PointOfCollision = res.PointOfIntersection}; } return new SegmentCollisionResult(); }