POV-Ray : Newsgroups : povray.general : A little vector problem : Re: A little vector problem Server Time
7 Aug 2024 15:20:25 EDT (-0400)
  Re: A little vector problem  
From: Chris Jeppesen
Date: 30 Aug 2001 15:18:28
Message: <3b8e9184$1@news.povray.org>
1) vdot()

given normalized vectors A and B, vdot(A,B) is 1 if they are parallel/equal,
0 if perpendicular, -1 if pointing in opposite directions, and in general,
cos(angle between). So the condition you are looking for is vdot(A,B)<0.

Given general normalized or un-normalized vectors,vdot(A,B)>0 means angle
less than 90, vdot(A,B)=0 are perpendicular, and vdot(A,B)<0 means angle
more than 90.

2) vdot(vnormal(A),vnormal(B))=1 for any two parallel vectors

Chris

"Micha Riser" <mri### [at] gmxnet> wrote in message
news:3b8e877a$1@news.povray.org...
> What is the easiest (fastest) way to check in pov whether the angle
between
> two normalized vectors is >90 degrees? I am currently testing if
> vlength(A-B)>sqrt(2)
>
> And what is the easiest way to check if two colinear vectors point in the
> same direction?
>
> - Micha


Post a reply to this message

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