![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 11 Jan 2004 10:56:24 -0500, Warp <war### [at] tag povray org> wrote:
> The result of the dot-product of two vectors is a scalar which is the
> product of the lengths of the two vectors multiplied with the cosine of
> the angle between them.
> 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.
I think you left out the most useful thing: the dot-product is 0 when the
two vectors are perpendicular to each other (since the cosine of 90
degrees is 0)
--
light_source{20*y,1}#macro _(M,X,Y,P)#macro L(N,D)#if(N)#declare
P=P+D;box{-
0.5,0.5translate z*mod(9*P.gray,4)pigment{rgb P}rotate 45*x+clock*y
translate
P}L(N-1,D)#end#end#if(M)L(mod(M,8)<mod(X,3)mod(Y,3)1>-1)_(div(M,8)div(X,3)div
(Y,3)P)#end#end _(2301603551,12850,60365,20*z-5*x)plane{y,-9pigment{rgb 1}}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mikael Pohjola <emp### [at] cc hut fi> wrote:
> I think you left out the most useful thing: the dot-product is 0 when the
> two vectors are perpendicular to each other (since the cosine of 90
> degrees is 0)
It certainly is useful, but why is it *the most* useful feature?-)
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <opr1pzvldo0x9foi@news.povray.org>,
Mikael Pohjola <emp### [at] cc hut fi> wrote:
> I think you left out the most useful thing: the dot-product is 0 when the
> two vectors are perpendicular to each other (since the cosine of 90
> degrees is 0)
I'd say this is even more useful: if the dot product is > 0, the vectors
point in roughly the same direction (less than 90 degree angle), if it
is < 0, they point in opposite directions (greater than 90 degree
angle). And there are many other uses...finding intersections with
various objects, for example. (the plane intersection equation is little
more than two dot products)
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <4001f8e5@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> Christopher James Huff <cja### [at] earthlink net> wrote:
> > 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.
>
> Only if A is a unit vector. (If it isn't, you need to normalize
> it first.)
Right...I always forget to say that. And to clarify, it's only the part
about the angle that's wrong: acos(A.x) only means the angle in radians
if A is unit-length, it does mean the same thing as acos(vdot(A, x)).
You need acos(A.x/vlength(A)) or acos(vdot(A, x)/vlength(A)). Or, given
two arbitrary vectors, acos(vdot(A, B)/(vlength(A)*vlength(B)))
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |