pnr

E-Mail #119322 10-DEC-91 00:53 (Fw by Lbird, Reply to #119041)
From: Marvin
  To: Lbird (private message) 
  Re: Marv man..  

The formula for inertia is 1/2mv^2 if I remember right.  It is the same
as something else, but I just woke up, and can't remeber off hand what
that is.  Let's see, distance traveled is x=1/2at^2 + vt + x1.  I guess
I just answered my last question.  If you differentiate, you get the
function for velocity, or, dx/dt=v=at + v1.  OK, I imagine your looking
for a new velocity, which is that formula, so you need to work force
into the formula, so f=ma.  That means, your new velocity at any point
in time is v=ft/m + v1 (where v1 is your previous velocity).  The mass
is easy to take care of, unless you want the ships to accellerate at
different rates (e.g. - different class ships, small ones accelerate
quicker, but have less fire power, and/or are more easily destroyed),
just assume it to be 1.  This is all relative, so it doesn't matter one
what.  If you do want them to have different inertias, just use a one
for the smallest ship, and use a ratio for the others (i.e. a ship twice
as large would be two).  So the formula is now, v=ft + v1.  Now, the
force is the same as the mass, you can just use 1, or you can have
afterburners that consume more fuel but move you faster, or you can have
some ships with more thrust, but less firepower.  I imagine just
changing the mass should be enough unless you want to start using fuel
guages.  So, just drop it from the equation.  Now, you have v=t + v1.
Now all you need is a scaler to make this equation reasonable.  Figure
your time in whatever intervals you use in checking what they are
pushing, and your velocity in whatever units you have, and
as long as they are hitting the thrusters, increase/decrease their speed
each time increment by At + v1 (A is the scaler), but since this is one
time interval, this is A + v1.  Just add the scaler to their origninal
velocity each time increment.  Boy, I wonder if my math was right on
that, it seems too simple.

I don't know if you are working in polar of rectangular coordinates, but
to find their new velocity in polar coordinates, take the direction they
are heading at any time, I'll use the letter @ for the angle, and their
velocity would change by Acos@ in the horizontal plane and Asin@ in the
vertical plane.  So for a demo, say they hit their thrusters for two
time periods at an angle of 45 degrees.  Their speed would be:

2A cos 45 + 2A sin 45

cos 45 = sin 45 = 0.707, so their velocity would be 1.414A  up, and
1.414A to the right, or 2A at 45 degrees.

Now if they faced straight down and hit the thrusters, one the next time
interval, their new velocity would be (1.414A,1.414A) + (Acos 270, Asin
270), or (1.414A,1.414A) + (0,-A), which is (1.414A,.414A), or 1.47A at
16.3 degrees.

Sounds reasonable to me.  What do you think?

_Ron

(R)eply, (E)rase, (F)orward, (C)opy, (B)acktrack, (P)revious, or (N)ext? 