Sylvester 0.1.3

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.







3 Responses to “Sylvester 0.1.3”

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);

MrABC added these pithy words on Nov 17 08 at 11:10 am

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?

MrABC added these pithy words on Nov 17 08 at 11:13 am

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.

var rect = [$V([2,2]), $V([2,5]),
            $V([7,5]), $V([7,2])];

Then you multiply each point with the rotation matrix to transform them:

var rot = Matrix.Rotation(Math.PI/2),
    i = rect.length;

while (i--) rect[i] = rot.x(rect[i]);

Or, use the Vector#rotate method.

James added these pithy words on Nov 19 08 at 11:08 am

Leave a Reply