Rotate a vector around another vector?

Miscellaneous Forums/General Discussion/Rotate a vector around another vector?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

TeaMonkey, thank you. Here is the function, translated to Blitz:

;Rotate the point (x,y,z) around the vector (u,v,w)
Function RotatePointAroundVector(x#,y#,z#,u#,v#,w#,a#)
ux#=u*x
uy#=u*y
uz#=u*z
vx#=v*x
vy#=v*y
vz#=v*z
wx#=w*x
wy#=w*y
wz#=w*z
sa#=Sin(a)
ca#=Cos(a)
x#=u*(ux+vy+wz)+(x*(v*v+w*w)-u*(vy+wz))*ca+(-wy+vz)*sa
y#=v*(ux+vy+wz)+(y*(u*u+w*w)-v*(ux+wz))*ca+(wx-uz)*sa
z#=w*(ux+vy+wz)+(z*(u*u+v*v)-w*(ux+vy))*ca+(-vx+uy)*sa
End Function


It might be possible to simplify it further, since this is for a point, and I just need to rotate the vector (a point with a magnitude of 1.0).