Hi, im currently trying to figure out how to develop a method in my program that takes care of the forces and updates the positions of the rectangle after collision with a wall. At the moment, i just have it moving inside the walls. i know the equations of motion in terms of acceleration and understand they need to be integrated in the RK4 method and respective positions x1,y1,theta1, and x2,y2,theta2 can be then calculated, and these positions updated....the thing i really need to know is what other equations do i need? and how do i apply the angular position to the x,y positions? im not sure about the inertia/torque either.....for drawing the rectangle im using (x1,y1) (x2,y2) positions as opposed to (x,y,w,h)...here are the equations i know i need for the RK4 method for (x1,y1) of the rectangle:
vx1' = (− k vx1) ⁄ m
vy1' = (− m g − k vy1) ⁄ m
ω' = − k ω ⁄ I
x1' = vx1
y1' = vy1
θ' = ω
k=damping const, I=inertia, omega=angular velocity
Any help would be greatly appreciated as this has been bugging me for a while....Thanks