POV-Ray : Newsgroups : povray.general : Rotation angle of a vector around z axis : Re: Rotation angle of a vector around z axis Server Time
30 Jul 2024 00:25:35 EDT (-0400)
  Re: Rotation angle of a vector around z axis  
From: Slime
Date: 27 Mar 2010 19:38:41
Message: <4bae9701$1@news.povray.org>
You can simply use atan2( vect.y, vect.x ). Note that this is equivalent to 
atan( vect.y / vect.x ) but avoids the problem of division by zero.

This will give you the angle in radians. If you want it in degrees, use 
degrees( atan2( vect.y, vect.x ) ).

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.