#9728: Moving the Linear transformations interact from wiki into the library.
--------------------------------------------------+-------------------------
Reporter: punchagan | Owner: itolkov, jason
Type: enhancement | Status: needs_review
Priority: minor | Milestone:
Component: interact | Keywords:
Author: Puneeth Chaganti, Nishanth Amuluru | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------------------------+-------------------------
Comment(by pang):
I want to propose some changes to this interact:
* Adding a 2x3 transformation (affine, I guess) does not fit with
plotting vectors, IMHO. I'd stick to linear transformations and possibly
add a second interact for affine transformations.
* Use input_grid instead of input_box for the matrix.
* Why plot two concentric circles? It is useful to communicate that the
aspect_ratio is 1, but if the axes are present, I don't think it's
necessary.
* Why not plot the unit sphere, and its image under A, instead? Using the
same colors as with the vectors, this makes the idea more clear.
So how about using the following code instead:
{{{
@interact
def linear_transformation(
theta = slider(0, 2*pi, .1),
r = slider(0.1, 2, .1, default=1),
A = input_grid(2, 2, default = [[1,-1],[-1,1/2]],
to_value=matrix)):
"""An interact which illustrates ...
"""
v=vector([r*cos(theta), r*sin(theta)])
w = A*v
unit_sphere = circle((0,0), radius = 1, rgbcolor = (1,0,0))
var('t')
image_of_sphere = parametric_plot(A*vector([sin(t),cos(t)]),
(t, 0, 2*pi), rgbcolor=(0,0,1))
html("$v = %s,; %s w=%s$"%(v.n(4),latex(A),w.n(4)))
show(v.plot(rgbcolor=(1,0,0)) +
w.plot(rgbcolor=(0,0,1)) +
unit_sphere + image_of_sphere,
aspect_ratio=1)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9728#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.