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

Allow for coordinate changes in curve plots #32578

Closed
egourgoulhon opened this issue Sep 28, 2021 · 7 comments
Closed

Allow for coordinate changes in curve plots #32578

egourgoulhon opened this issue Sep 28, 2021 · 7 comments

Comments

@egourgoulhon
Copy link
Member

In Sage 9.5.beta2, the following attempt to plot a cardioid fails:

sage: E.<r,ph> = EuclideanSpace(coordinates='polar')
sage: c = E.curve((1 + cos(ph), ph), (ph, 0, 2*pi))
sage: c.plot(chart=E.cartesian_coordinates())
...
ValueError: No expression has been found for Curve in the Euclidean plane E^2
 in terms of Chart (E^2, (x, y))

This is because the curve c is known only in polar coordinates and no attempt is made to compute its expression in terms of Cartesian coordinates. Forcing the latter computation by e.g.

sage: c.display(chart2=E.cartesian_coordinates())

before invoking c.plot(chart=E.cartesian_coordinates()) makes things work.

In the current ticket, the method plot is modified, so that the expression in the coordinates specified by the argument chart is computed by means of ContinuousMap.coord_functions. Moreover, this simplifies significantly the code of DifferentiableCurve.plot.

CC: @tscrim @mjungmath @mkoeppe

Component: manifolds

Keywords: curve, plot

Author: Eric Gourgoulhon

Branch/Commit: 5ac0f28

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32578

@egourgoulhon
Copy link
Member Author

Branch: public/manifolds/curve_plot-32578

@egourgoulhon
Copy link
Member Author

New commits:

5ac0f28Allow for coordinate changes in curve plots (Trac #32578)

@egourgoulhon
Copy link
Member Author

Commit: 5ac0f28

@tscrim
Copy link
Collaborator

tscrim commented Sep 29, 2021

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Sep 29, 2021

comment:2

LGTM.

@egourgoulhon
Copy link
Member Author

comment:3

Thank you for the review!

@vbraun
Copy link
Member

vbraun commented Oct 13, 2021

Changed branch from public/manifolds/curve_plot-32578 to 5ac0f28

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

No branches or pull requests

3 participants