POV-Ray : Newsgroups : povray.general : Field of View : Re: Field of View Server Time
7 Aug 2024 17:21:37 EDT (-0400)
  Re: Field of View  
From: David Fontaine
Date: 6 Aug 2001 17:48:35
Message: <3B6F0E97.97949E45@faricy.net>
Tor Olav Kristensen wrote:
> 
> David Fontaine wrote:
> ...
> > I wrote a macro to find the angle between two vectors.
> >
> > #macro vangle(vec1,vec2)
> >    #local len1 = vlength(vec1);
> >    #local len2 = vlength(vec2);
> >    #local len3 = vlength(vec2-vec1);
> >    acos((pow(len3,2)-pow(len1,2)-pow(len2,2))/(-2*len1*len2))
> > #end
> >...
> 
> Hello again David
> 
> I haven't tested your macro, nor the one below,
> but I think this one will do the same job:
> 
> #macro VAngle(v1,v2)
> 
>   acos(vdot(vnormalize(v1), vnormalize(v2)))
> 
> #end // macro VAngle
> 
> (But maybe you already knew that ;)

I think I tried that too but I had some reason for changing it... maybe
not?

-- 
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.