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