Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineSegment.intersection(with:) not working properly #22

Open
nazariyg opened this issue Oct 6, 2020 · 1 comment
Open

LineSegment.intersection(with:) not working properly #22

nazariyg opened this issue Oct 6, 2020 · 1 comment

Comments

@nazariyg
Copy link

nazariyg commented Oct 6, 2020

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

@revolter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants