POV-Ray : Newsgroups : povray.general : 3D trig hurt brain! (or, Another Stupid Math Question) : Re: 3D trig hurt brain! (or, Another Stupid Math Question) Server Time
6 Aug 2024 10:21:07 EDT (-0400)
  Re: 3D trig hurt brain! (or, Another Stupid Math Question)  
From: Tor Olav Kristensen
Date: 8 Apr 2002 19:59:19
Message: <3C895AE1.D33F8D61@online.no>
Xplo Eristotle wrote:
> 
> If this were 2D it would be easy for me, but it isn't 2D and this is
> making me use up my scratch paper to no purpose...
> 
> If you have a line (line segment? maybe) with a known length, starting
> at a known set of coordinates, which is then rotated around those
> coordinates by arbitrary amounts around the x and z axes, how do you
> calculate the coordinates of the other end of the line?

Warning: Untested code below


The original "line":

cylinder { pA, pB, CylRad }


// Assuming that you wish the x-axis rotation
// to take place before the z-axis rotation:
#declare pNewB = pA + vrotate(pB - pA, <AngleX, 0 AngleZ>);

The rotated "line":

cylinder { pA, pNewB, CylRad }



Tor Olav


Post a reply to this message

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