-
Bacon-wrapped closures
Nice Big Quadratic Mess
Okay, I've been working on an equation for a ping-pong game that will allow the computer to "aim" from its current position (xs and ys) at a variable angle (theta) to a certain spot on the table (xf and yf) at a given speed (V), while being acted on by constant gravity (a). I've managed to get an equation that I think is right, but algebra alone doesn't seem to be enough math background to isolate t. (Note that I had to use a few strange symbols since this forum doesn't allow for special characters: t=theta; +/- should be ontop of eachother; sqrt=square root)
V*cos(t) = (a(xs-xf))/(-V*sin(t)+/-sqrt(V^2*sin(t)+2a(ys-yf)))
Any help is appreciated.
-
Are you trying to solve this for a particular variable or what?
-
Bacon-wrapped closures
Yes, I'm trying to solve for t.
-
solve it for what? I'm assuming one of the final positions. The only problem is that you have two unknowns and only one equations
-
Bacon-wrapped closures
I guess I'm not understanding what you're saying. The end result I'm looking for is an equation with only t on one side, and the rest of the variables on the other, with no recurrences of t.
-
Oh...and it actually does say that in your first post, sorry. whew, that's a toughie with the two sins and the cos. I'll give her a go, but I wouldnt expect myself to be able to solve it. Off the top of my head, I would think my strategy would be to square everything, then sin^2 + cos^2 = 1. The one sin is under the square root, leaving it just sin(t). The inverse sin for the answer...thats the plan, not sure how well it will work.
-
V*cos(t) = (a(xs-xf))/(-V*sin(t)+/-sqrt(V^2*sin(t)+2a(ys-yf)))
makes no sense... specifically the
...sin(t)+/-sqrt(...
looks like a typo, so if you could fix it maybe?
edit: oh man, this is old... i hope you still needed help with that ...er i hope you dont need help, er something. i dunno.
-
Senior Member
Well.. that was narky! If you havent solved it yet (its been 10 days or so) then this is what I got
Code:
t = acos((a(xs - xf)) / (V(-V * sint +/- sqrt(V^2 * sint + 2a(ys-yf)))))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|