public c_intersection[] get_intersections(c_line_segment other) { c_rectangle intersection = size.get_intersection(other.size); if (intersection != null) { return(intersection.to_int_vectors().Select(i => new c_intersection(i, base_distance + i.taxi_distance(start) + other.base_distance + i.taxi_distance(other.start))).ToArray()); } else { return(new c_intersection[0]); } }
public c_line_segment(c_vector s, int d, c_vector e) { start = s; base_distance = d; size = new c_rectangle(s, e); }