POV-Ray : Newsgroups : povray.general : 3D trig hurt brain! (or, Another Stupid Math Question) Server Time
7 Nov 2024 07:32:19 EST (-0500)
  3D trig hurt brain! (or, Another Stupid Math Question) (Message 1 to 5 of 5)  
From: Xplo Eristotle
Subject: 3D trig hurt brain! (or, Another Stupid Math Question)
Date: 8 Apr 2002 19:46:08
Message: <3CB22C28.D1CA5219@unforgettable.com>
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?

-Xplo


Post a reply to this message

From: Warp
Subject: Re: 3D trig hurt brain! (or, Another Stupid Math Question)
Date: 8 Apr 2002 19:57:02
Message: <3cb22e4e@news.povray.org>
Xplo Eristotle <inq### [at] unforgettablecom> wrote:
> 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?

  With vrotate() ;)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: 3D trig hurt brain! (or, Another Stupid Math Question)
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

From: Xplo Eristotle
Subject: Re: 3D trig hurt brain! (or, Another Stupid Math Question)
Date: 8 Apr 2002 20:08:28
Message: <3CB23164.B1CCA3F4@unforgettable.com>
Warp wrote:
> 
> Xplo Eristotle <inq### [at] unforgettablecom> wrote:
> > 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?
> 
>   With vrotate() ;)

Doh!!

Okay, thanks guys (note to self: RTFM again).

-Xplo


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: 3D trig hurt brain! (or, Another Stupid Math Question)
Date: 8 Apr 2002 20:09:49
Message: <3CB22DC7.B16EE501@online.no>
Tor Olav Kristensen wrote:
>...

Sorry for the wrong date.


Tor Olav


Post a reply to this message

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