Math Help?

Jeff Massung massung at gmail.com
Fri Apr 30 16:56:29 EDT 2010


On Fri, Apr 30, 2010 at 3:43 PM, Scott Rossi <scott at tactilemedia.com> wrote:

>
> Dot products... normalized vectors... head starting to spin... vision
> getting blurry...
>

Hehe. ;-)


>
> OK, Jeff, so does (B-A).x mean the x coordinate of point B minus the x
> coordinate of point A?
>
>
Yes. This might help:

freespace.virgin.net/hugo.elias/routines/r_dot.htm

2D dot product:

dot(p1,p2) = (p1.x * p2.x) + (p1.y * p2.y)

In this case, since you are dealing with line segments, the segment AB would
mean that:

p1.x = B.x - A.x
p1.y = B.y - A.y

Expanding this out...

dot(AB, AD) = [(B.x-A.x) * (D.x-A.x)] + [(B.y-A.y) * (D.y-A.y)]

Hope that helps!

Jeff M.



More information about the use-livecode mailing list