c - TrigMath, 2 masses, rigid rod computing velocity -


like else, doing thrust clone brush up. have arrived @ stage ship picks pod.

essentially have 2 masses (consider centre of sphere only) connected rigid, massless rod. l never changes, doesn't break.

balls!

in case, ship(ma) has mass 1.0, , pod(mb) has mass 2.0. math required compute new positions? when apply thrust ship(ma), how apply pod(mb)? (and make swing around expected) doing ship straight forward, usual velx-=sin(angle)*thrust, vely+=cos(angle)*thrust. posx+=velx. etc. know used know how this, school soo many years ago.

here 2 approaches you.

the first simpler. relax rigidity. make bar joins 2 spring. equal , opposite force exerts on both of them proportional amount length has been displaced. if make spring rigid, you'll have rigid bar simply.

the second make bar rigid. in case entire system can described position , velocity of center of mass, , angle , rate of rotation of whole system. center of mass weighted average of positions of points in system times mass @ point. in case point 2/3 of way along bar towards pod. (because pod weighs twice ship does.) no matter pushing, center of mass move if pushed right @ center of mass, know how move center of mass.

now have consider rate of rotation. when apply force @ ship, fraction of @ right angles bar. fraction, in addition moving center of mass, making system spin. portion of force accelerating ship not pod. apply force ship, , can figure out rate of acceleration. center of mass accelerating @ 1/3 rate ship is. point of view of center of mass, 2/3 of sideways acceleration of ship going making system spin. divide 2/3 distance center of gravity ship, , have angular acceleration.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -