How to know if a segment is completely included between two lines? I have three segments (not necessarily parralel):


*

*blue $((ax1, ay1), (ax2, ay2))$

*green$((bx1, by1), (bx2, by2))$

*red $((cx1, cy1), (cx2, cy2))$


and a $margin$ value which is the width of the sky blue band in the sketch bellow (with infinite length and always centered to the blue segment).

Is there a way to know if a segment is completely in the sky blue band knowing the coordinates of each segment and the value of the margin ?

Of course. Since the band is convex, to make sure the segment is completely in the band, you only need two endpoints in the band. (It is applicable for all convex domains)
