MaiaVictor
MaiaVictor

Reputation: 52987

Generic algorithm for the rotation of vectors around an axis without using matrixes or quaternions?

I don't understand why matrixes and quaternions are necessary for that operation. Why don't we just write a function such as rotate(vector,axis,angle) which applies an algebraic formula, performing the rotation directly? What would be that formula?

Upvotes: 0

Views: 167

Answers (2)

Brett Hale
Brett Hale

Reputation: 22318

Because the 'algebraic formula' will be functionally equivalent. Could you easily discern useful properties like concatenations and inverses without these more abstract concepts?

And abstraction is one of the fundamentals of programming.

Upvotes: 1

Petar Ivanov
Petar Ivanov

Reputation: 93040

You don't have to have a matrix object (it just makes it a lot easier) to do that. You can of course have the algebraic formula to do that and the formula is the formula for matrix multiplication with a vector. But again - the matrix notion is just a way to remember the formula, nothing else.

Quaternion multiplication is just a different way to remember (express) the same formula. But again again - it's the same formula written in a different (very clever indeed) way.

You can't have two different formulas to do the same thing, right - any two should be equivalent to each other.

Upvotes: 1

Related Questions