sparkzbarca
New member
- Joined
- Jul 18, 2013
- Messages
- 2
ok so this is for a computer program.
I have the general idea of how to solve for one my issue is the whole moving target thing.
i'm using
timeToTarget = Mathf.Sqrt(2 * Distance / Projectile.MetersPerSecond);
or more generally
time = squareroot of 2 * distance / acceleration
or else using
time = distance / speed;
in the cases where speed is constant.
then the target i'm plotting an intercept for i have its current position and velocity.
so i aim at the point where the target will be time seconds ahead.
This is where the issue arrives though
the aimpoint time seconds ahead have a different distance (and therefore time to target)
then what i'm calculating.
so if the target is travelling fast enough i'd have to do the calculation again to get distance and time to target to the now known aimpoint.
Except of course the known aimpoint produces itself a new aimpoint.
Each time i get more approx close to the "true" intercept aimpoint.
But while i can try do something where i loop a algorithm and keep trying to find the aimpoint until i get within a certain tolerence i'm wondering if there is a better way.
I hope this comes across clearly. Basically I have a projectile going towards a target and i want to calculate the point to aim at which will allow me to hit the target given the targets position and speed and the projectiles position and speed.
But the issue i'm having is finding the distance between the target and the projectile because each projection of where the target will be changes the distance from what it was to the distance to the projection. Meaning the aimpoint now isn't correct.
I have the general idea of how to solve for one my issue is the whole moving target thing.
i'm using
timeToTarget = Mathf.Sqrt(2 * Distance / Projectile.MetersPerSecond);
or more generally
time = squareroot of 2 * distance / acceleration
or else using
time = distance / speed;
in the cases where speed is constant.
then the target i'm plotting an intercept for i have its current position and velocity.
so i aim at the point where the target will be time seconds ahead.
This is where the issue arrives though
the aimpoint time seconds ahead have a different distance (and therefore time to target)
then what i'm calculating.
so if the target is travelling fast enough i'd have to do the calculation again to get distance and time to target to the now known aimpoint.
Except of course the known aimpoint produces itself a new aimpoint.
Each time i get more approx close to the "true" intercept aimpoint.
But while i can try do something where i loop a algorithm and keep trying to find the aimpoint until i get within a certain tolerence i'm wondering if there is a better way.
I hope this comes across clearly. Basically I have a projectile going towards a target and i want to calculate the point to aim at which will allow me to hit the target given the targets position and speed and the projectiles position and speed.
But the issue i'm having is finding the distance between the target and the projectile because each projection of where the target will be changes the distance from what it was to the distance to the projection. Meaning the aimpoint now isn't correct.