use kika::{
Point2, Segment2, SegmentIntersection2, segment_intersection, segment_intersection_kind,
};
fn main() {
let s1 = Segment2::new(
Point2::new(0.0, 0.0).unwrap(),
Point2::new(4.0, 4.0).unwrap(),
);
let s2 = Segment2::new(
Point2::new(0.0, 4.0).unwrap(),
Point2::new(4.0, 0.0).unwrap(),
);
println!("kind: {:?}", segment_intersection_kind(s1, s2));
match segment_intersection(s1, s2) {
SegmentIntersection2::Point(p) => {
println!("crossing point: ({}, {})", p.x(), p.y());
}
SegmentIntersection2::Overlap(seg) => println!("collinear overlap: {seg:?}"),
SegmentIntersection2::None => println!("no intersection"),
}
}