Saturday, November 18, 2006

SVD: The Applet

Given my web traffic patterns, it seems I am becoming an unwitting explicator of the Singular Value Decomposition. My original intent was simply sharing some ideas with the graphically inclined. There are certainly many who can more write capably on this, but it's a subject I find cool and there appears to be sufficient outside interest, so I guess I'll carry on when I feel inclined.

Lately curiosity has been pulling me into experiments with JavaScript and ExplorerCanvas. I decided to combine these two pursuits with the SVD to see if I could construct something useful, and I managed to stumble my way through enough HTML, JavaScript and Canvas code to make a little SVD applet.

When it comes to the state of vector graphics on the Web, the situation feels almost criminal. Some of this feeling may be due to my experiences as an advocate of SVG (Scalable Vector Graphics). This is an area where open standards would be [would have been] great, but the players seem to insist on fighting for total domination. In the process, it feels like the Balkan world of vector on the Net has been set back years.

I like the idea behind ExplorerCanvas. If you can't beat 'em, join 'em (with an adapter). The basic idea is a Canvas implementation in IE. By leveraging Microsoft's VML, ExplorerCanvas makes it possible to write vector code (Canvas) that works in Firefox, Safari, Opera and IE. Check out the ExplorerCanvas site for more info.

My experiences with ExplorerCanvas revealed some bugs and unimplemented features. Rendering transformed arcs, for example, didn't work, so I wound up creating my own paths. Inconsistencies in line style scaling between IE and Firefox, etc. That said, the project looks like a promising undertaking.

For background on this applet, I recommend you read this post and probably the one before it. In the applet, you can specify a 2x2 matrix A. The effect of A on the unit circle is shown. You can see the relationship between the vectors of V and U as well as the relationship between S and the scale of the axes of the resulting ellipse.


(p.s. please make a comment or send me a note if you find any bugs... software is made to be broken. Also, if you're flying blind, small numbers less than four will work best.)


Post a Comment

Subscribe to Post Comments [Atom]

<< Home