Opened 14 months ago
Closed 14 months ago
#32578 closed defect (fixed)
Allow for coordinate changes in curve plots
Reported by: | Eric Gourgoulhon | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.5 |
Component: | manifolds | Keywords: | curve, plot |
Cc: | Travis Scrimshaw, Michael Jung, Matthias Köppe | Merged in: | |
Authors: | Eric Gourgoulhon | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | 5ac0f28 (Commits, GitHub, GitLab) | Commit: | 5ac0f28559ab278a19833beb28761207fa1a2174 |
Dependencies: | Stopgaps: |
Description
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
.
Change History (4)
comment:1 Changed 14 months ago by
Branch: | → public/manifolds/curve_plot-32578 |
---|---|
Cc: | Travis Scrimshaw Michael Jung Matthias Köppe added |
Commit: | → 5ac0f28559ab278a19833beb28761207fa1a2174 |
Status: | new → needs_review |
comment:2 Changed 14 months ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
LGTM.
comment:4 Changed 14 months ago by
Branch: | public/manifolds/curve_plot-32578 → 5ac0f28559ab278a19833beb28761207fa1a2174 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
New commits:
Allow for coordinate changes in curve plots (Trac #32578)