Metron icon indicating copy to clipboard operation
Metron copied to clipboard

LineSegment.intersection(with:) not working properly

Open nazariyg opened this issue 3 years ago • 1 comments

Confirming that LineSegment.intersection(with:) may return nil for valid intersection cases:

let s1 = LineSegment(a: .init(x: 187.50440979003906, y: 543.5147094726562), b: .init(x: 333.1461486816406, y: -109.8446273803711))
let s2 = LineSegment(a: .init(x: 0, y: 0), b: .init(x: 375, y: 0))
let intersection = s1.intersection(with: s2) // nil

Should not be nil, as the two segments are intersecting at a point:

Screen Shot 2020-10-06 at 10 22 03 PM

nazariyg avatar Oct 06 '20 19:10 nazariyg

Off-topic: What software did you use to create that image?

revolter avatar Apr 14 '22 17:04 revolter