Rounding out today’s flurry of posts, a quick note to the effect that Sylvester is now at version 0.1.3. The 0.1.2 release missed a couple of bugs that I meant to fix with it. Well not bugs, as such, but places where value/reference ambiguity could have caused problems. I’m beginning work on 0.2 again, after a long break focusing on other projects and house hunting. This should be the final 0.1 release, unless I find any particularly catastrophic bugs.
I’m writing a book. It’s called JavaScript Testing Recipes.
Hello! i have a question.
ex:
i have 4 point (a rectangle)
and i want to rotate them in 90°
code:
angle = Math.PI/2;
var a = $M([
[2,2,0],
[2,5,0],
[7,5,0],
[7,5,0]
]);
var b = $V([7,2,0]);
R = Matrix.Rotation(angle);
test = R.add(a.elements);
sry i wrote wrong, sory
ex:
i have 4 point (a rectangle)
and i want to rotate them in 90°
code:
angle = Math.PI/2;
var a = $M([
[2,2,0],
[2,5,0],
[7,5,0],
[7,2,0]
]);
R = Matrix.Rotation(angle);
result = R.add(a);
Dis i do wrong? i try to read the Tutorial
http://sylvester.jcoglan.com/api/matrix
but i cant get it! sry
can you help me?
You’re trying to add two matrices of different sizes, which doesn’t make mathematical sense. The way to model your problem is with vectors: vectors represent single points in space.
Then you multiply each point with the rotation matrix to transform them:
Or, use the Vector#rotate method.
Anyone port Sylvester to Actionscript? Even though they have a Matrix class, there’s little support. There is a Clevrlib1 which has some more, including SVD and QR decomposition, but it doesn’t support Vector, Plane, Line, except as special cases of Matrix.