This content has been marked as final.
Show 8 replies

1. Re: 2D plane reflection
843853 Feb 15, 2010 11:37 PM (in response to 843853)If you are talking random collisions in space:
arcTan(dY/dX ) = Theta
cos(Theta) * Scale (movement distance) = X vector
sin(Theta) * Scale (movement distance) = Y vector
Do this for each object and add up all the X vectors, than add up all the Y vectors separately. Now from the point of contact you have a dY/dX so you can calculate the new angle Theta. 
2. Re: 2D plane reflection
843853 Feb 15, 2010 11:37 PM (in response to 843853)You have a given that there is a right angle involved, do you have a dY/dX value from your trajectory so atan(dY/dX)=angle, transpose the origin to your impact point and change your dY/dX appropriatelyOr if you impact in the X direction, just negate your X inc and you have it, the same goes for the Y. 
3. Re: 2D plane reflection
843853 Feb 16, 2010 2:24 AM (in response to 843853)I have a body, in this case a ball, colliding with a line. I need the angle of the normal on this line. 
4. Re: 2D plane reflection
843853 Feb 16, 2010 10:02 AM (in response to 843853)dY/dX of your line gives you the slope in your screen coordinate system:
arcTan(dY/dX)+90 will give you a normal to that line. This will work for all random angles in your coordinate system.
please take note, that scale*cos(angle) and scale*sin(angle) will still give vectors back into your coordinate system if you work it this way. 
5. Re: 2D plane reflection
843853 Feb 16, 2010 4:11 PM (in response to 843853)what exactly is dY and dX? sorry. 
6. Re: 2D plane reflection
843853 Feb 17, 2010 12:17 AM (in response to 843853)dX is read as deeex and dY is read as deewhy. In calculus they mean the change in X and the Change in Y, when you see dX/dY it is a derivative and gives a tangent to a curve. In your case it is used as the tangent, and simply calculated by (X1X0)/(Y1Y0). To get the curve itself you use the inverse of the Tangent function or ArcTan. 
7. Re: 2D plane reflection
jwenting Feb 25, 2010 6:57 AM (in response to 843853)tomster1996 wrote:
you claim to know physics and don't know the symbology related to the mathematical representation of even simple mechanics?
what exactly is dY and dX? sorry. 
8. Re: 2D plane reflection
843853 Feb 28, 2010 4:31 AM (in response to jwenting)jwenting wrote:
If I already knew about this, i wouldn't need to be here. I've got this sorted anyway.tomster1996 wrote:
you claim to know physics and don't know the symbology related to the mathematical representation of even simple mechanics?
what exactly is dY and dX? sorry.