I just cant get my head round the maths behind the rigid body, i'm just too thick when it somes to math and math symbols. Wonder if someone could perhaps explain or show me what it means cos I dont have a clue.
I'll start by explaining what I done so far and post some links to the definations, and then if someone wouldnt mind telling me how badly I done

These are the links i've been looking at:-
AccelerationVelocityTorqueRigid body dynamicsI have absolutely no idea what I am doing, I dont understand the equations for Rigid body dynamics at all.
Here is some code, i've cut it down to simplify it, if I ever get it working i'll post the full code to it.
Square\dx# and Square\dy# is the velocity vector ( from the center of the square )
Square\odx# and Square\ody# is the previous velocity vector ( from the center of the square )
; Assuming a collision is detected do the following
; fyi all the vectors origin is at the center of the square
;
; Square\timePassed# = Milliseconds passed so divide with 1000 to convert to seconds
;
; Force = Mass * Acceleration
; Acceleration is the rate of change in velocity over time a = v/t
;
Square\velocity# = VectorLength#( Square\dx# - Square\odx#, Square\dy# - Square\ody# )
Square\acceleration# = Square\velocity# / ( Square\timePassed# / 1000.0 )
Square\force# = Square\mass# * Square\acceleration#
;
; Angle between the velocity vector and point of impact vector
;
angle# = -getAngle( impactX#,impactY#, Square\dx#, Square\dy#, 0,0 )
;
; torque = distance to center * Force * sin( angle )
;
distance# = VectorLength#( impactX#, impactY# )
Square\torque# = Square\force# * distance# * Sin( angle# )
;
; Convert torque to angular velocity
;
Dunno how to do this
;
; Returns the length of a 2d vector
;
Function VectorLength#( x#,y# )
Return Sqr#( x# * x# + y# * y# )
End Function
;
; gets the angle between two vectors
; x1,y1 vector 1, x2,y2 vector 2, ox,oy origin
;
Function getAngle#( x1#,y1#, x2#,y2#, ox# = 0,oy# = 0 )
Local tvAx# = x1# - ox#
Local tvAY# = y1# - oy#
Local tvBx# = x2# - ox#
Local tvBY# = y2# - oy#
Local d# = ATan2#( tvAy#, tvAx# )
Local tvCx# = Cos#( d# ) * tvBx# + Sin#( d# ) * tvBy#
Local tvCy# = -Sin#( d# ) * tvBx# + Cos#( d# ) * tvBy#
Local newAngle# = ATan2#( tvCy#, tvCx# )
If ( newAngle# > 0.0 )
newAngle# = -(180.0 - newAngle#)
Else
newAngle# = -(-180.0 - newAngle#)
EndIf
Return newAngle#
End Function
Some insight would be much appreciated
