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

Help using Circles intersection #36

Closed
penbeuz opened this issue Jan 2, 2021 · 1 comment
Closed

Help using Circles intersection #36

penbeuz opened this issue Jan 2, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@penbeuz
Copy link

penbeuz commented Jan 2, 2021

Hello, trying to use your library for mechanical calculation but not being a mathematicians I don't understand how to use the result of intersection of circles.

C1 = Circle(Point(0,0),5)
C2 = Circle(Point(8,0),5)
l = Line(Point(4,0), Point(4,1))
A = C1.intersect(C2)
B = C1.intersect(l)
C = C2.intersect(l)

This is the result of circles intersection

A
[Point((5.014458341998072+0.010710064639031416j), (0.13325313668481312-0.40303121043641016j)),
 Point((19.770205823088897-0.16649271512070937j), (0.17208666613531612+19.12754381209912j)),
 Point((19.770205823088894-0.16649271512071231j), (-0.17208666613532006-19.12754381209912j)),
 Point((5.014458341998073+0.010710064639031925j), (-0.1332531366848131+0.4030312104364105j))]

The expected points are on both intersections of line with circles

Point(4.0,3.0) in B
True
Point(4.0,-3.0) in B
True
Point(4.0,3.0) in C
True
Point(4.0,-3.0) in C
True

But not on intersection of circles

Point(4.0,3.0) in A
False
Point(4.0,-3.0) in A
False

What am I missing ?
Thanks an best regards

@jan-mue
Copy link
Owner

jan-mue commented Jan 3, 2021

There seems to be a mathematical error in the formula that we use to calculate the intersections of two conics. The two circles should obviously have the two expected points of intersection and two additional complex points of intersection. I will look into this issue.

@jan-mue jan-mue added the bug Something isn't working label Jan 3, 2021
@jan-mue jan-mue closed this as completed Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants