-
Notifications
You must be signed in to change notification settings - Fork 95
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
inversion(circle1, circle2) in geometry.asy not always correct #143
Comments
Which version of Asymptote are you using? There are multiple examples there and none of them given in asy. Can you please refer to specific ones if not providing your asy code for them (which would be the best)? |
Hello @ivankokan I refer to the code here: https://github.com/vectorgraphics/asymptote/blob/master/base/geometry.asy. |
You did not understand me.
|
I'm using Asymptote 2.44, but I commented the code in Ok, I will provide an example. Please wait. |
Here is an example in the case Case when one circle contains the other.
Actually I think that only the case Case when the circles are outside each other is correct in |
Thanks, I will check later today. |
@stla I will first concentrate on the cases where the radii are not equal. Demo:
Expected outcome: (at least) one among red and green circles should be congruent with the blue one, and it does not happen in all cases. I will try to track the issue and fix the bug ASAP. |
@stla I did the math on the paper, you can expect the fix this week. |
Hi @stla, @johncbowman. I have a question for you on top of fixing things here. Considering the fact that for given two circles might exist two resulting inversions (corresponding to both internal and external midcircles), it is necessary to change the prototype of the following function: Line 6362 in 7929623
There are at least two options:
Option 1 is not backward-compatible (it would change return type) but I do not think that would be a big issue. Option 2 is backward-compatible, and maybe more user-friendly or semantically driven. Please share your thoughts. Edit. Additional observation: for some cases there is no inversion at all, e.g. there is no negative inversion for two intersecting congruent circles. Hence, return type will be changed to |
To improve backwards compatibility, you could also add an implicit cast from |
Yes, I agree. This clearly makes Option 1 the best choice. |
Hello,
The function
inversion(circle1, circle2)
ingeometry.asy
, which intends to return an inversion which swaps the two circles, is not correct for all cases. See this article on my blog for the complete list of cases.The text was updated successfully, but these errors were encountered: