1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Moving ball colliding with a side of a cube

  1. Aug 21, 2012 #1
    1. The problem statement, all variables and given/known data

    assuming the path of the ball is linear, if the ball collides with the cube, I want to find which side the cube the ball collided with. this is a discreet problem, the ball's position and velocity are always known. the cube's size is bigger than the ball's size in the way that the ball's radius is negligible in this problem, and the time step is small enough so that the change in position of the ball in different time step is also small enough.


    2. Relevant equations

    line equation using ball's current position and velocity
    plane equation using 3 corners of a side of the cube

    3. The attempt at a solution

    I figured the collision took place once the ball just penetrates the cube, and the solution is to determine the line equation of the ball and the plane equation of the six sides of the box and determine which plane the line segment is intersecting.

    the problem is I don't know how to calculate the equation of the line in 3D and equation of planes and then calculation for the intersections. I have forgotten much of the math needed to solve problems like this...
     
  2. jcsd
  3. Aug 21, 2012 #2

    CWatters

    User Avatar
    Science Advisor
    Homework Helper

    Where they touch one co-ordinate will match one of the co-ordinates of the plane and the others will be in bounds. So consider a cube with one corner at the origin (0,0,0) and another at (1,1,1). Then you can check if the surface of the ball is on one of the faces eg if any of these conditions are true..

    0, 0<y<1, 0<z<1
    or
    1, 0<y<1, 0<z<1
    or
    0<x<1, 0, 0<z<1
    or
    0<x<1, 1, 0<z<1
    or
    0<x<1, 0<y<1, 0
    or
    0<x<1, 0<y<1, 1
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Moving ball colliding with a side of a cube
  1. Kvl on left side (Replies: 6)

  2. Resistor Cube Problem (Replies: 8)

Loading...