On 5/27/10 10:35 PM, Vincent D wrote:

More generally, the way sage.plot is built seems to be dedicated
mostly to function graphs. Is it possible to attach geometric objects
to an underlying space? meaning that if I have a Square attached to
the euclidean plane, I would like to be able to act on it with a
matrix like in the following
{{{
sage: p = Polygon([(0,0),(0,1),(1,1)])
sage: m = matrix([[1,1],[0,1]])
sage: m*p  # the polygon made of the points (0,0), (1,1), (2,1)
}}}
e.g. to see a Polygon more as a subset of an homogeneous space with a
complete metric than a plot object.


I think that would be cool, even just from the standpoint of teaching linear algebra or calc 3 and playing with linear transformations. And I don't see why you'd need to limit it to things like Polygons. It would be cool if you could do:

p=plot(whatever)
m*p # transform each coordinate

I think it would be very straightforward to do this using the underlying 2d matplotlib library, which has a very nice transformation framework builtin [1] (in other words, we could probably easily just save up the transformations, like we currently do with 3d plots, and then apply the transformations on output, which should just be a matter of one or two matplotlib calls at the very end right before drawing). On the 3d side, Sage has a transformation framework, so it should be straightfoward to make m*p do something cool there too.

I wonder if it would help if the graphics were inside the coercion system.


Jason

[1] http://matplotlib.sourceforge.net/devel/transformations.html

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to