(no subject)

Date: 2011-03-30 11:25 am (UTC)
Yes. Follow it now. dot project for projection of position vector onto line vector. Use that to establish distance. Use that to establish position, and then work out he square difference.

I'm just a bit confused by this line:

var t = DotProduct(diffX, diffY, dirX, dirY) / DotProduct(dirX, dirY, dirX, dirY);

Isn't the dot product going to be scaled by the square root of that? In my case it doesn't matter because my motion vector is a unit vector plus a speed but I'm a little confused that I don't quite get it.

EDIT: Ah! Got it! The result is scaled by length but so is the initial vector. So we divide by that squared!
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting
Page generated Aug. 1st, 2025 12:59 pm
Powered by Dreamwidth Studios