here this code I ended up using thanks to alephzero
if([tile isRock])
{
c = magnitude(d); \\d is a CGPoint of distance (x & y components) between two objects
if(c <= 0.5) // ball collides
{
float x_tan, y_tan, det, A, B...
Thanks so much for all the help. Everything seems to be working great.
When I looked over the values for the determinant again, it does seem pretty impossible that the determinant would result in 0. But I would rather include a check just in case something else glitched & doesn't cause the...
Thanks for the link, ill have to give it a good look through
ok so then I just have to take the magnitude to find the corresponding velocity components
X_v = sqrt((-A*xn)^2 + (B*xt)^2)
Y_v = sqrt((-A*yn)^2 + (B*xt)^2)
Also to solve the system of equations in a program, it seems easiest...
Yes one obstacle will always be static. The image (from wikipedia) was something I was using to ask if I could assume that the new velocity vector is orthogonal to the vector between the centers of the objects, which I think you are agreeing to in your post.
I'm sorry but I'm just not...
I am trying to program the elastic collision response between a ball and an immovable obstacle (such as a rock with infinite mass). However I can't seem to figure out the angle at which the ball would bounce off of the object. Both objects are to be considered as circles, with their positions...