Author Topic: Rotating Vectors  (Read 972 times)

is it possible to not use trig to rotate unit vectors equally around the origin (0, 0, 0) such that vector A will end up being (1, 0, 0)?
I mostly care about the end result of vector B from it

what I was thinking of is using vector A as a basis (with itself in it's own grid being (1, 0, 0)) to try and scale everything from that
that way when I find vector B in terms of vector A's coordinate grid, it would be the end desired result

You should look into transformation matricies: https://en.wikipedia.org/wiki/Transformation_matrix

If you don't want to use trig because you don't know it, then just remember that whatever you end up doing will be equivalent to using trig because math doesn't change just because you use a different process.  You might as well learn it.

If you want to rotate using Euler angles you can use:

MatrixMulVector(MatrixCreateFromEuler(rotation), vector)

This might help you
http://forum.blockland.us/index.php?topic=270070


Edit: What are you trying to do exactly? There might be a simpler way of doing it.
« Last Edit: September 30, 2015, 05:20:28 AM by boodals 2 »

I know trig, I'm just trying to solve this problem without it
I have a feeling it might be slightly faster to find a point (or vector) in terms of another basis instead of using trig to rotate everything with sin/cos

This might help you
http://forum.blockland.us/index.php?topic=270070


Edit: What are you trying to do exactly? There might be a simpler way of doing it.
I'm writing a helper method which will probably be used by other things, but the current thing I'm coding it for is to flip a point over a line
To do that I'm probably going to normalize both vectors, convert the line vector into the basis of the point, find it's YZ components and use that as the length to scale the unit vector by, and then I can just subtract one point from the other to get the flipped point

I also plan on using it as standalone and in other methods though