Professional Documents
Culture Documents
This document is intended to introduce you to solving 2-dimensional elastic collision ro!lems "or circles without com licated trigonometry# $t is much easier to use vectors to solve 2dimensional collision ro!lems than to use trigonometry# $" you are un"amiliar with vectors% a we! search "or &vectors& should yield a variety o" introductions# 'e aware that vectors are commonly re resented in two ways# (ne way is to s eci"y a magnitude and an angle# The other is to s eci"y the com onents )ty ically in the * and y directions+# The two "orms re resent the same in"ormation and can !e interconverted% !ut "or some tas,s one "orm may !e more convenient than the other# Trigonometry is im ortant "or understanding the conce t o" vectors# -owever% the goal o" this document is to avoid tedious )and com utationally e* ensive+ trigonometry# There"ore we will only use the com onent re resentation o" a vector% not the magnitude and angle "orm# This reduces the actual com utations to addition% su!traction% multi lication% division% and s.uare roots# /otation: Throughout this document% m is mass and v is velocity# 0u!scri ts 1 and 2 distinguish !etween the two colliding o!2ects# 3n a ostro he a"ter a varia!le means that the value is ta,en after the collision )called prime4 i#e#% v' is 5v rime6+#
unit tangent
unit normal
/e*t we need the unit tangent vector# This is easy to "ind "rom the unit normal vector# >ust ma,e the x com onent o" the unit tangent vector e.ual to the negative o" the y com onent o" the unit normal vector% and ma,e the y com onent o" the unit tangent vector e.ual to the x ut =un y , un x com onent o" the unit normal vector: 2# Create the initial )!e"ore the collision+ velocity vectors% v1 and v2# These are 2ust the x and y v 1= v 1* , v1y )and similarly "or v2 +# /ote com onents o" the velocities ut into vectors: that this ste really isn9t necessary i" the velocities are already re resented as vectors# This ste is needed only i" the velocities are initially re resented as se arate x and y values# 3# ?ee in mind that a"ter the collision the tangential com onent o" the velocities is unchanged and the normal com onent o" the velocities can !e "ound using the one-dimensional collision v1 and v2 % into normal "ormulas resented earlier# 0o we need to resolve the velocity vectors% and tangential com onents# To do this% ro2ect the velocity vectors onto the unit normal and unit tangent vectors !y com uting the dot roduct# Let v1n !e the scalar ) lain num!er% not a vector+ velocity o" o!2ect 1 in the normal direction# Let v1t !e the scalar velocity o" o!2ect 1 in the tangential direction# 0imilarly% let v2n and v2t !e "or o!2ect 2# These values are "ound !y
ro2ecting the velocity vectors onto the unit normal and unit tangent vectors% which is done !y ta,ing the dot roduct: v 1n= un v1 v 2n= un v2 v 1t = ut v1 v 2t= ut v2 @# =ind the new tangential velocities )a"ter the collision+# This is the sim lest ste o" all# The tangential com onents o" the velocity do not change a"ter the collision !ecause there is no "orce !etween the circles in the tangential direction during the collision# 0o% the new tangential velocities are sim ly e.ual to the old ones: v, v, 1t = v1t 2t = v 2t Aemem!er that the a ostro he a"ter the varia!le name means 5a"ter the collision#6 B# =ind the new normal velocities# This is where we use the one-dimensional collision "ormulas# The velocities o" the two circles along the normal direction are er endicular to the sur"aces o" the circles at the oint o" collision% so this really is a one-dimensional collision# v 1n m1m2 2 m2 v 2n v2n m2m1 2 m1 v 1n v, v, 1n = 2n = m1 m2 m1 m2 C# Convert the scalar normal and tangential velocities into vectors# This is easyD2ust multi ly the unit normal vector !y the scalar normal velocity and you get a vector which has a direction that is normal to the sur"aces at the oint o" collision and which has a magnitude e.ual to the normal com onent o" the velocity# $t is similar "or the tangential com onent# , , , , , , , , v 1n= v1n un v 1t =v 1t ut v 2n= v 2n un v 2t = v 2t ut <# =ind the "inal velocity vectors !y adding the normal and tangential com onents "or each o!2ect: , v v, v, 1= 1n 1t , v v, v, 2= 2n 2t
/ow we have the "inal )a"ter collision+ velocity o" each o!2ect as a vector# To see these "ormulas in action% chec, out: 'ouncesco e )htt :EEwww#vo!arian#comE!ouncesco eE+# This "ree rogram allows you to simulate lots o" !alls !ouncing around elastically# The mass% si8e% initial velocity% and color o" each !all can !e customi8ed% or you can add !atches o" randomly generated !alls# The source code is rovided# To chec, "or u dated versions o" this document% visit: htt :EEwww#vo!arian#comEcollisionsE Fo!arian 0o"tware home age: htt :EEwww#vo!arian#comE =eed!ac, and comments are welcome via the e-mail address listed on the Fo!arian 0o"tware we!site# G2009 Chad 'erche,