NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 19, 2019, 12:27:09 pm
 Welcome, Guest. Please login or register.Did you miss your activation email? 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length

 Home Help Search Login Register
A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"

 Pages: 1 2 [3]   Go Down
 Author Topic: Collision 2D  (Read 154399 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Bluzkin
Newbie

Offline

Posts: 3

 « Embed this message Reply #60 on: November 19, 2010, 02:08:33 am » posted from:Amsterdam,Noord-Holland,Netherlands

Hello Fu-Kwun Hwang. This really helped me. For my finals I chose to make a physics simulation application (in Game Maker 8.0) including brownian motion.

I have tried to get the final formula for v1' with the first two equations but I just can't get it right. Could you maybe send me the the steps you took to get there? That would be great.

I also don't know how to calculate the component of a force (or other vector) in a certain direction so if you could help me with that I would really appreciate it.

Thanks in advance.

(I don't know if I double posted but I think my first post wasn't processed or something...)
 Logged
Fu-Kwun Hwang
Administrator
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #61 on: November 19, 2010, 11:53:24 am » posted from:,,Taiwan

I assume you know how to find vector which connect between center of two particles.
if one is (x1,y1,z1),another one is (x2,y2,z1). then the vector $\vec{r}$ is (x2-x1,y2-y1,z2-z1).
Assume velocity of particle 1 is$vec{v}$= (vx1,vy1,vz1),
The velocity component in the vector $vec{r}$ direction can be calculated as $\vec{v_p}=(\vec{v}\cdot\vec{r})/r^2 \vec{r}$,where $r$ is the length of velocity $\vec{r}=\sqrt{(x2-x1)^2+(y2-y1)^2+(z2-z1)^2}$

i.e.
vx1'=((vx1*(x2-x1)+vy1*(y2-y1)+vz1*(z2-z1))/r^2) (x2-x1)
vy1'=((vx1*(x2-x1)+vy1*(y2-y1)+vz1*(z2-z1))/r^2) (y2-y1)
vz1'=((vx1*(x2-x1)+vy1*(y2-y1)+vz1*(z2-z1))/r^2) (z2-z1)

And the velocity compendicular to $vec{r}$ is $\vec{v_n}=\vec{v}-\vec{v_p}$

P.S. The inner product between $\vec{A}$ and unit vector $\hat{n}$ will give you magnitude of projection of vector $\vec{A}$ in the direction of $\hat{n}=\vec{r}/r$, so the component in the direction $\hat{n}$ is $(\vec{A}\cdot\hat{n}) \hat{n}$
 Logged
Bluzkin
Newbie

Offline

Posts: 3

 « Embed this message Reply #62 on: November 21, 2010, 12:40:39 am » posted from:Amsterdam,Noord-Holland,Netherlands

Thanks! that really helped.

Now I just need to understand JS and have a look at the source code
 Logged
lookang
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #63 on: April 11, 2011, 07:51:27 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

some more error when clicking 'VIEW  ejs xml source'
OOPS! EJS XML file (airplane.xml) does not exists!

download it working correctly though
 Logged
Fu-Kwun Hwang
Administrator
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #64 on: April 11, 2011, 05:51:32 pm » posted from:Taipei,T'ai-pei,Taiwan

Thank you for reporting the problem. It is fixed now.
 Logged
 Pages: 1 2 [3]   Go Up
A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"
Jump to:

 Related Topics Subject Started by Replies Views Last post 2D Collision « 1 2 ... 5 6 » Dynamics Fu-Kwun Hwang 177 494282 January 04, 2019, 11:22:20 pm by kacpero12345 Elastic collision and in-elastic collision Dynamics Fu-Kwun Hwang 0 10304 May 24, 2009, 04:10:14 pm by Fu-Kwun Hwang 4 car collision going through two intersections Request for physics Simulations Kennyg10 1 7397 August 06, 2009, 11:51:32 am by Fu-Kwun Hwang 1 D collision carts Elastic and Inelastic Collision dynamics ahmedelshfie 6 13798 April 27, 2010, 02:16:18 am by ahmedelshfie Collision 2D dynamics ahmedelshfie 1 5407 September 24, 2010, 07:22:37 pm by ahmedelshfie
Page created in 1.074 seconds with 22 queries.since 2011/06/15