How Do Rectangles Collide on an Orthogonal Plane with Given Velocities?

  • Thread starter Thread starter r4nd0m
  • Start date Start date
  • Tags Tags
    Collision
Click For Summary
SUMMARY

The discussion focuses on determining the first collision point between two rectangles (ABCD and EFGH) on an orthogonal plane, given their velocity vectors. The solution involves using mathematical principles such as distance, velocity, and time to derive equations of motion for each rectangle. The collision detection can be approached through bounding-box checks, ensuring that the edges of one rectangle intersect with the edges of the other. For precise calculations, it is essential to find the intersection points of the rectangles' sides using mathematical formulas.

PREREQUISITES
  • Understanding of basic physics concepts such as velocity and motion.
  • Familiarity with mathematical equations for line intersection.
  • Knowledge of bounding-box collision detection algorithms.
  • Proficiency in C programming for implementing the solution.
NEXT STEPS
  • Study the mathematical principles of motion equations for moving objects.
  • Learn about bounding-box collision detection techniques in computer graphics.
  • Research algorithms for calculating line intersections in 2D space.
  • Explore visualization tools to represent motion and collision points effectively.
USEFUL FOR

Mathematics students, game developers, and programmers working on collision detection algorithms in 2D environments.

r4nd0m
Messages
96
Reaction score
1
I wonder if somebody could help me with this problem I'm solving for my c language class (but it's more a mathematical problem I think).
So we have 2 different rectangles (ABCD and EFGH) in an ortogonal plane, their sides are parallel to the axes of the ortogonal system. Each of this rectangles is given a velocity vector. Now the task is to determine where the first collision will take place (where these two rectangles (their sides or corners) will meet the first time) if it will take place.
Any suggestions?
Can this problem be solved via mathematicl formulas?
thanks a lot
 
Physics news on Phys.org
I would have to think more about this to solve it mathematically, but if you're talking about computing a bounding-box collision when it happens, what you do is check at every step to see if the two boxes have collided. This will happen if and only if the top or bottom line of one box is between the bottom line of the other box and the top line of the other box, AND the left or right line of one box is between the left and right lines of the other box.

This is not totally precise--you could miss a corner collision in between steps, if the steps are large enough and the collision is close enough to the corners. To do it mathematically would require more work.
 


Hello,

This is an interesting problem that combines both mathematics and programming. To solve this problem, you can use mathematical formulas and principles such as distance, velocity, and time. First, you would need to determine the equations of motion for each rectangle based on their velocity vectors. Then, you can use these equations to calculate the positions of the rectangles at any given time.

To determine the collision point, you would need to find the intersection of the two rectangles. This can be done by finding the equations of the lines that make up the sides of each rectangle and then solving for the point of intersection. If the rectangles do not intersect, then there is no collision and you can simply continue to track their positions until they do intersect.

I suggest breaking down the problem into smaller steps and tackling each one systematically. Also, it would be helpful to create a visual representation of the problem to better understand the motion and potential collision points of the rectangles.

I hope this helps and good luck with your problem-solving!
 

Similar threads

Replies
20
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
3K
Replies
34
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
1
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
4K