This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-03 07:02:56

crazycat3
Scratcher
Registered: 2010-12-11
Posts: 8

Physics

I am planning to make a game which includes physics, but I don't know much about it.
What is the angle and velocity of a ball if:

1. It is hitting another bigger ball(which is not moving)?
2. It is inside the outline of a bigger ball and it is about to hit the side?
3. It is hitting the corner of a square?

Offline

 

#2 2012-06-03 07:06:23

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Physics

You need to calculate the shared tangent, then bounce the ball off of that just like you would bounce it off a line.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2012-06-03 08:43:22

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Physics

And how would you calculate the shared tangent in Scratch, without actually knowing the co-ordinates or radius of the ball?

Offline

 

#4 2012-06-03 08:46:22

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Physics

Well then what do you know?  hmm


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5 2012-06-03 08:48:38

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Physics

Hardmath123 wrote:

Well then what do you know?  hmm

Right... suppose you drew the circles with the pen and have to sense everything.

Offline

 

#6 2012-06-03 18:46:30

crazycat3
Scratcher
Registered: 2010-12-11
Posts: 8

Re: Physics

What if for 1 and 2 you know the radius, the speed and the coordinates of both balls?
For 3 you know the coordinates and the speed of both the ball and the corner.
Is it possible to solve it then?

Offline

 

#7 2012-06-04 01:44:35

BornAgainAtheist
New Scratcher
Registered: 2012-02-13
Posts: 42

Re: Physics

crazycat3 wrote:

What if for 1 and 2 you know the radius, the speed and the coordinates of both balls?
For 3 you know the coordinates and the speed of both the ball and the corner.
Is it possible to solve it then?

Do you know the math for a ricochet? The tangent is just the direction to the smaller ball +90 degrees. To find the direction between two points do this: https://sites.google.com/site/byobimages/_/rsrc/1338787932996/home/atan2/atan2.jpg

and if you don't know how to find the angle of deflection between two lines here is a solution:
https://sites.google.com/site/byobimages/_/rsrc/1338788588133/home/deflection/deflection.jpg

Offline

 

#8 2012-06-04 01:48:34

crazycat3
Scratcher
Registered: 2010-12-11
Posts: 8

Re: Physics

So basically you know anything that is needed except for the speed and angle the ball has
after it has bounced

Offline

 

#9 2012-06-04 02:02:52

crazycat3
Scratcher
Registered: 2010-12-11
Posts: 8

Re: Physics

BornAgainAtheist wrote:

Do you know the math for a ricochet? The tangent is just the direction to the smaller ball +90 degrees. To find the direction between two points do this: https://sites.google.com/site/byobimages/_/rsrc/1338787932996/home/atan2/atan2.jpg

and if you don't know how to find the angle of deflection between two lines here is a solution:
https://sites.google.com/site/byobimages/_/rsrc/1338788588133/home/deflection/deflection.j

Is it possible to explain it for me or tell what the variables are?

Offline

 

#10 2012-06-04 02:41:28

BornAgainAtheist
New Scratcher
Registered: 2012-02-13
Posts: 42

Re: Physics

For the direction finder I used trigonometry to find the direction from point (x,y) to point (dx,dy) it's not important in this case to understand how it works as long as you know how to use it. If you are curious, 'a' and 'b' are the differences between points (x,y) and (dx,dy).

In the case of the deflection function, 'approach' is the direction the object is approaching at and 'wall' is the direction the line being bounced of is pointing.

Offline

 

Board footer