Original Post
Hello, I'm posting for the first time on GameDev. I've heard it's a great place to find game programming help, so I had a question. I'm trying to work on a function involving a lot of vector math and I'm not sure how to do it. Let's say I've got two vectors A and B. A has the initial position of Apos, and B has the initial position of Bpos. If A also has a velocity of Avel quantified by it's speed and direction, and B has a set speed Bspeed, but no direction. I want to write a function to calculate the direction that the B vector would have to be to intersect with A. It would also have to be a function of time. Think of it as a sniper trying to shoot a moving target by leading the target. I want to write a function to calculate the direction and time to fire a bullet given a target's movement speed and direction and knowing how fast the bullet travels. Thanks in advance for the help. :)