i have Segment class who contain 2 sections , each section contain 2 point the X and Y coordinate.
Point class has getX() and getX() method.
public class Segment
{
private Point pointLeft;
private Point pointRight;
}
i want to find the overlap (is there is) between 2 sections:
public double overlap (Segment other)
{
}
how can i find it (only the X axis overlap)
the 2 sections parallel to X axis (each section has the same Y)