Calculating Missile Descent Angle for Target Intercept

In summary, if you want to calculate when to begin descending on a target when you know the angle of descent, you will need to use an arcing algorithm that changes the missile's direction over time to a desired direction. This algorithm involves a changeDirection() method that gets called each tick for the missile until it is facing the correct direction. The objective is to make the missile's x, y, and z components equal to the target's x, y, and z components, but not instantly. The missile should curve into the direction vector that sends it toward the target. To calculate when to begin the descent, you can use the arc length formula R*w*t, where R is the radius of the circle and w is the rotation speed
  • #1
Dumbledore
33
0
How would you go about calculating when to begin descending on a target when you know the angle of descent, but to reach the angle of descent the direction vector arcs like it would in real life. I'm very bad at math and terminology but I hope you get what I mean.

You know the targets position in 3 space. And the missiles position, velocity, etc.

The arcing algorithm (that changes the missiles direction over time to a desired direction) is done like this:

If the code isn't clear enough I can explain in english, just let me know. This changeDirection() method gets called each tick for the missile until it is facing the correct direction.

Code:
void Missile::changeDirection(const Point3F& newDirection, const S32 axis)
{ 
	F32 diff = 0.0f;
	mTargetDir = newDirection; 
	mAxis = axis; 
	isChangingDir = true;
	F32 speed = mCurrVelocity.len(); 
	mCurrVelocity.normalize();

	F32 unitsOfTurn =  mDataBlock->precision * 0.01;  // arbitrary number
	
	mTargetDir.z - mCurrVelocity.z

	if ( axis & Z )
	{
		if ( (diff = newDirection.z - mCurrVelocity.z) > 0 ) 
		{
			mCurrVelocity.z += unitsOfTurn;
			if ( mCurrVelocity.z > newDirection.z )
			{
				mCurrVelocity.z = newDirection.z;
			}
		}
		else if ( diff < 0 )
		{
			mCurrVelocity.z -= unitsOfTurn; 
			if ( mCurrVelocity.z < newDirection.z )
			{
				mCurrVelocity.z = newDirection.z;
			}
		}
	}

	if ( axis & X )
	{
		if ( (diff = newDirection.x - mCurrVelocity.x) > 0 )  
		{
			mCurrVelocity.x += unitsOfTurn;
			if ( mCurrVelocity.x > newDirection.x )
			{
				mCurrVelocity.x = newDirection.x;
			}
		}
		else if ( diff < 0 )
		{
			mCurrVelocity.x -= unitsOfTurn; 
			if ( mCurrVelocity.x < newDirection.x )
			{
				mCurrVelocity.x = newDirection.x;
			}
		}
	}

	if ( axis & Y )
	{
		if ( (diff = newDirection.y - mCurrVelocity.y) > 0 )  
		{
			mCurrVelocity.y += unitsOfTurn;
			if ( mCurrVelocity.y > newDirection.y )
			{
				mCurrVelocity.y = newDirection.y;
			}
		}
		else if ( diff < 0 )
		{
			mCurrVelocity.y -= unitsOfTurn; 
			if ( mCurrVelocity.y < newDirection.y )
			{
				mCurrVelocity.y = newDirection.y;
			}
		}
	}

	if ( mCurrVelocity == newDirection ) 
	{
		isChangingDir = false;
	}
	mCurrVelocity *= speed;

Any links or tips would be appreciated, thanks.
 
Last edited:
Physics news on Phys.org
  • #2
Okay let me rephrase the above question.

I have a missile traveling horizontal at an altitude of 200m. The target rests directly ahead along the x,y axis, but at ground level, so at altitude of 0m. If I curve into the direction vector that sends the missile toward the target, how do I calculate when to begin the descent?

I am calculating my curve like this:

targetDirection = { tx, ty, tz } <- this is the target vector
currentDirection = { x, y, z } <- this is the current direction vector the missile is traveling on.

The objective is to make x = tx, y = tx, z = tz. However, NOT instantly. So I add or subtract a finite quantity called C each tick to each component until it is equal to the target component.

To reiterate, I do this
tx - x
If the result is negative I subtract C from x because x is larger than tx, and we want x to equal tx.

I do this for each component until currentDirection == targetDirection.

My objective is to have missiles that fly and turn in a realistic fashion so if you know of a better way than please share. Thanks!
 
  • #3
OK. You have a couple of issues to deal with here...

1) A missile almost never fires directly at it's objective. For some reason passing understanding the people that design missiles want the launcher to stay intact so, the missile launches in the direction the laucher points, preferably close to the target as in a fighter in the six o clock behind a bogey, but not so optimal in the case of a ground launch, or non-optimal fighter launch. Result: The missile fires for X seconds to clear the launch facility so it's exhaust doesn't cook the launcher before turning to target.

2) Once clear the launcher the missile homes on it's target and corrects it's trajectory. How? Assuming the missile is not psychic, and that is FAF (Fire and Forget) as opposed to laser, radio, or other tagged targeting systems, it must adjust its position and trajectory to meet the target point. The math for that is simple.

3) Arcing is a visual phenomena. What if the missile is in space? Where are you viewing it from? Is the missile ballistic? (ie: will it meet the target before it's fuel exhausts [non-ballistic] or after it's fuel exhausts [ballistic]) Is the target stationary? (Yes, the Earth turns, so it's not exactly stationary)
 
  • #4
Hello,
1) yes my missile has a track delay before it aligns itself to a target.
2) the missile does have a built-in guidance system, but it is too cpu expensive and I'd prefer to not use it if the target is stationary (which is this case)
3) The arcing takes place as a result of a direction vector change, so it is more than a visual phenoma I would contend. And the Earth isn't spinning in my simulation so yes the target is stationary.

So I guess it is #3 that I am most worried about right now. I just need a way to calculate "the arc" i guess to determine when to begin turning toward the target. If say, I want to descend on my target at a 45 degree angle, how would I know when to begin arcing into that 45 degree direction vector so as to hit the target. If i wait till I am 45 degrees before i begin the arc it will miss because it turns.
 
  • #5
Have I got it right:
A missile flyies in straight line, above a target in straight line. The missile wants to know the time to start turning. The turn will be with a constant direction changing?(a circle). If the missile keeps turning the same amount in the same time interval, the trajectory is circle. Let's say Theta is the angle swept by the radius in a time t. The rotation speed let be w. Theta=w*t. The arc length is R*Theta=R*w*t, where R is the radius of the circle. the arc length is(considering the missile's speed v): v*t.
So: R*w*t=v*t. Now you have the R of the circle. You also have the coordinates for the 2 lines(missile and target trajectory). The radius of the circle is always perpendicular on the speed, so this is how u know the circle center: draw a perpendicular line down from the missile trajectory line. The center is in the point where the length of the perpendicular line is equal to the radius(R which you just computed before.) squareR=square(x-x0)-square(y-y0) [1]is the circle parametric equation. x0 and y0 are the center of the circle coordinates, you computed them when you draw down that line. u know R.
Now we can make ends meet: U have the target coordinates, (xt,yt), and missile coordinates(xm=v*t,ym). The coordinates of your circle are: x0=v*t,y0=ym-R.
In equation [1] replace x0 and y0. now fit it once with x and y of the target. The equation I got:
v*t=xt-squareroot(square(v/w)+square(yt-ym +v/w)) , were w is the turning angle of the missile (radians). v*t is the x coordinate of the missile when it should start turning. If u want the time, divide the equation by v.
Tell me if I didnt understand the problem.
 

Related to Calculating Missile Descent Angle for Target Intercept

1. How does a missile turn toward its target?

A missile turns toward its target by using guidance systems, such as sensors and onboard computers, to calculate the most efficient path to reach the target. The missile's fins or thrusters then adjust to steer it in the desired direction.

2. What factors influence a missile's turning ability?

The turning ability of a missile is influenced by factors such as its speed, size, weight, and aerodynamic design. Other factors, such as wind and atmospheric conditions, may also impact a missile's turning ability.

3. Can a missile turn in mid-air?

Yes, a missile can turn in mid-air using its guidance systems and control surfaces. Some missiles also have the ability to change their course multiple times during flight, making them even more difficult to intercept.

4. How accurate is a missile's turning toward its target?

The accuracy of a missile's turning toward its target depends on various factors, including the missile's guidance system, the accuracy of the target's location, and external factors such as wind and temperature. Generally, modern missiles have a high level of accuracy, with some being able to hit a target within a few feet of their intended location.

5. What happens if a missile fails to turn toward its target?

If a missile fails to turn toward its target, it may miss its intended target or hit it with less accuracy. In some cases, the missile may also malfunction and not reach its target at all. This is why extensive testing and quality control measures are in place to ensure the reliability and accuracy of missiles.

Similar threads

Replies
9
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
1K
Replies
4
Views
1K
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
5K
Replies
1
Views
821
Replies
2
Views
3K
  • Introductory Physics Homework Help
Replies
7
Views
1K
  • Introductory Physics Homework Help
Replies
9
Views
2K
Back
Top