Archived

This topic is now archived and is closed to further replies.

walkingcarcass

general projectile solutions

Recommended Posts

a particle must be projected from A with an initial velocity U so as to pass through the sphere [B,R] at time T with final velocity V=U+G*T. Constant acceleration G is known. Magnitude and direction of G are arbitary. S=|U| and T have a range of possible values (for different angles of elevation theta in the plane ABG) P=Gx(B-A) U.P=0 V.P=0 V.G>0 (final velocity must be falling) U.G<0 Let M and M' be the steepest and shallowest directions allowed for V. V must intersect M+k*(M'-M) with |k|<1 what methods can, given theta, yield ranges for T and S (two pairs of "if S=x, T=y") and a vector U which can be scaled by a number between the two values of S what methods can give ranges for theta and T given initial speed S? what methods can give ranges for theta and S given flight time T? ******** A Problem Worthy of Attack Proves It's Worth by Fighting Back [edited by - walkingcarcass on January 19, 2003 12:54:39 PM]

Share this post


Link to post
Share on other sites
Pfff... Try to remove the superfluous information from your posts in the future...

Let me summarize: You are shooting a projectile from point A to a sphere centered at B and you want to know the possible values for the initial velocity vector.

I know how to solve it, but first, I should ask: are you sure that your target is a sphere, and not a disk on the ground? If it hits the top of the sphere, but lands more than R away from B, is it ok? A disk is a lot easier to solve.

In both cases, the problem can be brought back to a 2D one. Do you know spherical coordinates? Let's say that phi is the angle in the xz plane of your initial velocity vector, and that phi = 0 corresponds to shooting "directly" at B. The minimum and maximum values for phi will be -atan(R / d) and atan(R / d), respectively, where d is the distance between A and B.

Now, for a given phi, your problem is 2D. At this point, knowing if your landing zone is a sphere or a disk makes a big difference. If it's a sphere, you'll have to find the maximum and minimum velocities to hit a circle of radius sqrt( R² - [d * tan(phi)]²). If it's a disk, you'll have to hit a line segment of length 2 * sqrt( R² - [d * tan(phi)]²), which is a lot easier.

If you can't figure out the rest by yourself, tell us what is your landing zone, and I can finish the calculations.

Cédric

[edited by - cedricl on January 19, 2003 12:10:47 PM]

Share this post


Link to post
Share on other sites
Now that you have edited your original post, your problem is a lot clearer...

The stuff I mentionned about the angle phi is still valid, but since you have now mentionned that gravity''s direction isn''t downward, you may have to rotate your "world" to make it so.

To continue my explanations, phi can vary between -atan(R / d) and +atan(R / d). For a given phi, we have to "slice" the world with a vertical plane that passes through point A and whose direction is phi, so that the problem becomes a 2D one. The plane will intersect the sphere, which gives you a circle of radius sqrt( R² - [d * tan(phi)]² ). The center of the circle will be the closest point on the plane to the center of the sphere.

Now, in 2D, our equations are

x = x0 + v * cos(theta) * t
y = y0 + v * sin(theta) * t + a * t² / 2

The equation of the circle is

(x - cx)² + (y - cy)² = r²

where cx and cy are the coordinates of the center of the circle.

By replacing the equations of movement into the equation of the circle, you get a nasty equation with at least one fourth degree term, and three unknowns: v (velocity), theta and t.
quote:
what methods can give ranges for theta and T given initial speed S
what methods can give ranges for theta and S given flight time T?

Numerical methods. There may be an analytical solution, but I''ll have to think about it. The problem is that there will be terms in v²cos²(theta) and in t^4. I''m not sure how to solve this, to find the possible range of two out of the three variables.

Cédric

Share this post


Link to post
Share on other sites
yeah sorry about all the chaff. sorta thinking out loud.

slicing or rotating the world seems a bit too much of an overhead. can 3d points known to be on a plane be represented as 2d coordinates (multiples of i (B-A?) and j (G?) vectors in the plane? would the solutions ultimately be any less correct if i and j are not unit perpendicular?

Then the extreme values of theta, S and T could be calculated for that space. (theta can''t be more than PI/2, and the minimum value depends on the steepest and shallowest allowed V. The given range of S and T may limit theta further)

S and T should be the same in world space and plane space, theta must be converted into a vector, knowing how to generate Us allows best-fit tests.

the obstacles are (all in the ai+bj plane space)
* calculating a and b for A, B, M, M'', N etc
* finding a relationship between S, T and theta
* targeting the sphere/disk at B now not perfectly round
* generating U from theta


********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites
quote:
Original post by walkingcarcass
slicing or rotating the world seems a bit too much of an overhead. can 3d points known to be on a plane be represented as 2d coordinates (multiples of i (B-A?) and j (G?) vectors in the plane? would the solutions ultimately be any less correct if i and j are not unit perpendicular?

Rotating the world sounds meaner than it is. You only have to find the angle between G and a downward vector, and rotate your points around the axis G X down_vector that passes through the point where the projectile is launched, so that''s only one rotation.

Similaryly, "slicing the world" is an equally simple operation. You only have to find the center of the "slice" of sphere (a circle), and its radius, which I have already described in my previous post.

As for solving the final equations, I''ve thought about it, and I''m affraid that you''ll have to use a numerical method. I''m not too qualified to tell you about these, so I''ll let others do it.

Cédric

Share this post


Link to post
Share on other sites
damn i hate numerical methods. ah well thanks anyway.

out of curiosity, can a point [x,y,z] easily be represented as (a[x1,y1,z1]+b[x2,y2,z2]) when vectors 1 and 2 are known and constant?

********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites
That's basic linear algebra; you can't represent every point (x, y, z) with a linear combination of only two vectors; you need three.

With two, you can build the equations

x = ax1 + bx2
y = ay1 + by2

and if you are "lucky", the solution of these two equations will also work with the third one:

z = az1 + bz2

Cédric

[edited by - cedricl on January 21, 2003 10:07:10 AM]

Share this post


Link to post
Share on other sites
but if all points in question lie on a known plane, surely they will all have the form (a*v1+b*v2) if v1 and v2 are 2 vectors in that plane

perhaps the points and plane will first have to be translated such that the plane passes through the origin... ?

********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites
If all the points lie in a plane, then you don''t have any problem at all...

P + a * v1 + b * v2 can be any point in the plane whose orientation is v1 and v2, and that passes through point P.

Cédric

Share this post


Link to post
Share on other sites