0
votes

I've just got started with physics. I'm using Java, though language does not matter obviously. Now I though I'd do something like this:

enter image description here

A ball with a certain speed, radius and mass hits a rectangle with a certain mass, width and height. Depending on where the ball hits the rectangle (how high up), and all the properties the ball and the rectangle have that i just mentioned, there will be different outcomes of the situation.

These are the four possible outcomes:

  • The ball bounces back because the rectangle was too heavy
  • The rectangle starts to wobble, but then goes back to normal
  • The rectangle falls to the right
  • The ball strikes through making the rectangle fall to the left

Please note, I don't expect you to write a program for me. I understand it is a lot to think off. But I have no idea how to start. I would really appreciated some guide lines and links to further reading about this (I was not sure what to google to find info about this.)

And also, I'm doing this to learn, so don't tell me to use an engine or anything like that.

1
Do you want to simulate this event in detail, or just determine which of the four will happen under given initial conditions?Beta
@Beta I want to be able to change the variables (properties) and simulate itlawls

1 Answers

2
votes

You are trying to build a simple physics simulator. This is a pretty involved problem, and you'll have to learn a certain amount of physics along the way.

I suggest you develop the simulator to handle these situations, roughly in this order:

  1. An object moves through space (constant velocity, no gravity).
  2. An object moves under the influence of a constant force (such as gravity).
  3. An object moves with a constraint (e.g. a pendulum, a rolling square).
  4. An object slides across a surface, with friction (both static and kinetic).
  5. Two objects collide inelastically (they stick).
  6. Two objects collide elastically (they bounce).

Once you have all of these, you will be able to simulate your ball and rectangle.