Ticket #8838 (closed enhancement: fixed)
make "arrow()" take 3d vectors
| Reported by: | jason | Owned by: | jason, was |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.6 |
| Component: | graphics | Keywords: | beginner |
| Cc: | kcrisman, ryan | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Jason Grout |
| Authors: | Ryan Grout | Merged in: | sage-4.6.alpha1 |
| Dependencies: | Stopgaps: |
Description
A convention we have is that graphics commands do the right thing depending on if 2d or 3d input is passed. We should make arrow() take 3-tuples to produce a 3d plot (by calling arrow3d).
Attachments
Change History
comment:3 Changed 3 years ago by jason
- Cc ryan added
In other words, this should work:
sage: arrow(vector([1,2,3]), vector([2,3,4]))
and should draw a 3d arrow.
Changed 3 years ago by ryan
-
attachment
trac_8838_arrow2d_3d.patch
added
make arrow() behave more like line()
comment:4 Changed 3 years ago by ryan
- Status changed from new to needs_review
here is a patch that changes the behavior of arrow() to be more like line().
If 2d coordinates are passed, arrow() returns an arrow2d() (the old arrow() function). If 3d coordinates are passed, arrow() will now return an arrow3d().
comment:5 Changed 3 years ago by jason
- Status changed from needs_review to needs_work
This looks great. However, for backwards compatibility, could you name the arguments to arrow() "tailpoint" and "headpoint". Now, this command won't work, whereas before it would:
arrow(tailpoint=(0,1), headpoint=(2,3))
We should keep our API unless there is a very good reason to change it.
Changed 3 years ago by ryan
-
attachment
trac_8838_arrow2d_arrow3d.patch
added
Updated patch (with Sage 4.5.3)
comment:7 Changed 3 years ago by jason
- Status changed from needs_review to positive_review
Looks good! Thanks!
Apply only trac_8838_arrow2d_arrow3d.patch
comment:10 Changed 3 years ago by mpatel
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-4.6.alpha1
