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

arc(ellipse, point, point) doesn't work in non-default coordsys #334

Open
jamadagni opened this issue Aug 6, 2022 · 3 comments
Open

arc(ellipse, point, point) doesn't work in non-default coordsys #334

jamadagni opened this issue Aug 6, 2022 · 3 comments
Assignees

Comments

@jamadagni
Copy link
Contributor

import geometry;
size(10cm, 0);
currentcoordsys = cartesiansystem(i = N, j = W);

point P = (0, 0), Q = (-5, 1);
real v = abs(P - Q);
point R = P + (0, v);  // by def R lies on circle with center P and radius PQ
draw(Q -- P -- R, red + blue);
dot(P, red);
dot(Q ^^ R, blue);
draw(arc(circle(P, v), Q, R), green);
shipout(bbox(0.25cm));

As you can see the arc doesn't connect Q and R. Removing the modification of currentcoordsys, this works. Please advise what is wrong.

@jamadagni
Copy link
Contributor Author

jamadagni commented Aug 6, 2022

import geometry;
size(10cm, 0);
currentcoordsys = cartesiansystem(i = N, j = W);

point P = (0, 0);
circle C = circle(P, 5);
point Q = angpoint(C, 90);
point R = angpoint(C, 135);
draw(C);
draw(arc(circle(P, 5), Q, R), green + 2);
dot(P ^^ Q ^^ R);

shipout(bbox(0.25cm));

This doesn't work either.

@jamadagni
Copy link
Contributor Author

Curiously, adding the coordsys modification to the given example of arc(ellipse, point, point) works. I don't understand why that example should work but my constructed examples don't.

@jamadagni
Copy link
Contributor Author

In view of issue #333 I think the problem is perhaps with the underlying drawing routine which fails to compensate for rotation of coordinate system because arc(ellipse, point, point) internally seems to just go via arc(ellipse, abscissa, abscissa) to arc(ellipse, angle, angle). But I am not sufficiently confident…

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