Created
October 25, 2014 18:57
-
-
Save shashi/e1ade8f935802d83ebc2 to your computer and use it in GitHub Desktop.
eigshow in Julia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A = [1 3; 4 2] / 4 | |
| blue = RGB(0., 0., 9.) | |
| red = RGB(9., 0., 0.) | |
| place(point) = (point .+ 1) ./ 4 .+ .25 | |
| drawpoints(points, c) = | |
| [(context(place(points[:, i])..., 0.005, 0.005), fill(c), circle()) | |
| for i = 1:size(points, 2)] | |
| x=slider(0:.01:2π, value=0.) | |
| xs=foldl(push!, Float64[0.1], x) # Accumilate previous values | |
| display(x) | |
| lift(xs) do xs | |
| xs = [cos(xs) sin(xs)]' | |
| Axs = A*xs | |
| compose(context(), [drawpoints(xs, blue), | |
| drawpoints(Axs, red)]...) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version for 0.5: