Is this how it should be done (rotating vector x around vector z for alpha degrees):(adsbygoogle = window.adsbygoogle || []).push({});

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;

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Rotating vector x around vector z

**Physics Forums | Science Articles, Homework Help, Discussion**