My little bro applied for a software design position. He mentioned working on a challenging pre-test and, since these things entertain me, I asked for a copy. He did his in about a day, unfortunately I am not as bright as he, and it has taken me two already.
Out of respect to the Vicious Cycle people and to keep my brother from getting in trouble, the bulk of these questions are not accessible unless you are authenticated.
Answer all questions using C or C++ code. This exercise is designed to test your 3D mathematics abilities as well as your overall software design skills. Optimization and efficiency are as important as organization and clarity of code. If you don't know how to approach a problem, then research a solution for it! Please don't leave anything unanswered.
Projectile Leading Problem: Given an initial shot position (Spos), a constant shot speed (Sspeed), an initial target position (Tpos), and a constant target velocity (speed + dir) (Tvel) derive the equation for calculating the shot direction (Sdir) such that at some time (t) the shot would hit the target. Be sure to derive an equation for t as well!
Write a function to compute these values (Sdir and t).