POV-Ray : Newsgroups : povray.advanced-users : Rotation mathematics : Re: Rotation mathematics Server Time
26 Sep 2024 17:45:43 EDT (-0400)
  Re: Rotation mathematics  
From: David Fontaine
Date: 10 Jan 2001 18:49:23
Message: <3A5CF3DE.8E0CD427@faricy.net>
Simon Lemieux wrote:

> Hi,
>   just finished my session and learned quite a few interesting things... such as
> 2D rotations, where in radians (0 <= r <= 2pi):
> x = cos(rad);
> y = sin(rad);
>
> Now, I was wondering how to add the Z coordinate? Is it possible? I guess a
> better use would be to have different angles, rotating around a given axis and
> use the cos&sin functions just like for x&y but substituting x&z for a yAxis
> rotation, etc...
>
> Is there any better math out there to help about rotations? Except for
> matrixes...

This is exactly what matrices are for! But here:

Rotate x: <x,y,z> -> <x,y*cos-z*sin,z*cos+y*sin>
Rotate y: <x,y,z> -> <x*cos+z*sin,y,z*cos-x*sin>
Rotate z: <x,y,z> -> <x*cos-y*sin,y*cos+x*sin,z>

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

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