Rotating vector x around vector z

  • Thread starter ddr
  • Start date
  • #1
ddr
Is this how it should be done (rotating vector x around vector z for alpha degrees):
assumes |x|*|z|<>0
xonz=(scalar_product(z,x)/(|x|*|z|))*z;
y=x-xonz;
assumes |x|<>0
result=cos(alpha)*x+sin(aplha)*(|y|/|x|)*y;
 

Answers and Replies

  • #2
ddr
correction

actually y=croos_vector(z,(x-xonz))/|x-xonz|^2
 
  • #3
508
0
Not quite. I should say:

answer = xonz + y cos [alpha] + z/|z| X y sin [alpha].

Where X means vector product. And y = x - xonz.

Note: There should be a simpler form to this. Try yourself, please!
 
Last edited:

Related Threads on Rotating vector x around vector z

  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
6
Views
3K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
10
Views
2K
Replies
3
Views
13K
Replies
2
Views
3K
Replies
9
Views
2K
  • Last Post
Replies
6
Views
26K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
2
Views
2K
Top