Rotating vector x around vector z

  • Thread starter ddr
  • Start date

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;
 

ddr

correction

actually y=croos_vector(z,(x-xonz))/|x-xonz|^2
 
512
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 for: Rotating vector x around vector z

  • Posted
Replies
7
Views
1K
  • Posted
Replies
6
Views
3K
  • Posted
Replies
1
Views
3K
Replies
10
Views
1K
Replies
3
Views
12K
Replies
2
Views
2K
Replies
9
Views
2K
  • Posted
Replies
6
Views
25K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving

Hot Threads

Top