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

Intersect between a line and circle doesn't work #8

Closed
RedHatter opened this issue Jul 26, 2018 · 1 comment
Closed

Intersect between a line and circle doesn't work #8

RedHatter opened this issue Jul 26, 2018 · 1 comment
Labels

Comments

@RedHatter
Copy link

RedHatter commented Jul 26, 2018

If I have a circle and a line passing through I would expect intersect to return an array on points where the line passes through the diamater of the circle. As far as I can tell what intersect acceally returns is an array of points where the line passes through the bounding box of the circle.

let center = new Flatten.Point(width / 2, width / 2)
let circle = new Flatten.Circle(center, width / 3)
let eighth = new Flatten.Line(center, new Flatten.Vector(-1, 1))
let points = circle.intersect(eighth)

See this observable

alexbol99 added a commit that referenced this issue Jul 27, 2018
- normalize line normal vector if line defined with (pt,vec)
@alexbol99
Copy link
Owner

Thank you @RedHatter for submitting this issue
Bug fixed in version 0.5.3
See this notebook

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

No branches or pull requests

2 participants