POV-Ray : Newsgroups : povray.general : normals function : Re: normals function Server Time
3 Aug 2024 16:18:56 EDT (-0400)
  Re: normals function  
From: Christopher James Huff
Date: 11 Jan 2004 12:00:07
Message: <cjameshuff-A7A76E.12002011012004@netplex.aussie.org>
In article <40017227@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   The good thing about the dot-product is that it's very easy to calculate
> with multiplications and additions only. The dot-product of <ux, uy, uz>
> and <vx, vy, vz> is ux*vx+uy*vy+uz*vz.

And it's worth mentioning what happens when you compute the dot product 
of a vector with one of the natural basis vectors (x, y, and z). Given 
the vector V = < a, b, c>:
V dot x = a*1 + b*0 + c*0 = a
V dot y = a*0 + b*1 + c*0 = b
V dot z = a*0 + b*0 + c*1 = c

So writing vdot(A, x) is the same as writing A.x, which happens to be 
the notation used in mathematics for dot products...though it actually 
comes from C, where it is used to refer to a member of a struct.

Anyway, that means acos(A.x) means the same thing as acos(vdot(A, x)): 
the angle in radians between the vector and the x axis.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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