Comments and answers for "Calculating force"
http://answers.unity.com/questions/1156051/calculating-force.html
The latest comments and answers for the question "Calculating force"Comment by elenzil on elenzil's comment
http://answers.unity.com/comments/1157155/view.html
right on! glad this worked for you.Fri, 18 Mar 2016 16:25:19 GMTelenzilComment by KingNeil on KingNeil's answer
http://answers.unity.com/comments/1157118/view.html
This works super well! You can just set the velocity to speed, and it will work! **Thank you so much!**Fri, 18 Mar 2016 15:30:22 GMTKingNeilComment by KingNeil on KingNeil's answer
http://answers.unity.com/comments/1157056/view.html
Thank you very much for your help!
Looks like [this][1] formula might work, but it gives me the distance, and not the velocity, and i don't know how to reverse it.
Anyways, i will see if i can figure it out.
[1]: https://upload.wikimedia.org/math/c/1/d/c1da5860501561519415962ddda5e85e.pngFri, 18 Mar 2016 13:44:40 GMTKingNeilAnswer by elenzil
http://answers.unity.com/answers/1156845/view.html
yes. slightly different derivation than above, but:
// speed = +/- sqrt( GX^2 / (2C * (SX - CY)) )
// where
// X, Y = location of target
// C, S = cosine & sine of theta
// G = gravity
float speed = float.NaN;
float C2_times_SX_minus_CY = 2f * C * ((S * X) - (C * Y));
float G_times_X_SQUARED = G * X * X;
if (Mathf.Approximately(C2_times_SX_minus_CY, 0f)) {
// divide by zero
}
else if (C2_times_SX_minus_CY < 0f) {
// imaginary answer
}
else {
// hokay
speed = Mathf.Sqrt(G_times_X_SQUARED / C2_times_SX_minus_CY);
}
you'll need to modify this to deal with the fact that your launch point is not at the origin (or reconfigure scene so that is), and also this formula gives you the launch speed, but you're asking for the launch force. i'm not sure how to compute the force from the speed, but hopefully that's relatively simple.
also, if you allow the launch angle to be pointing in the opposite direction from the target, this formula will produce a wrong result, because it's assuming the "+" portion of "+/-" sqrt().
i put up a [live demo here][1]
fun stuff !
[1]: http://elenzil.com/progs/parabolaFri, 18 Mar 2016 05:46:36 GMTelenzilComment by elenzil
http://answers.unity.com/comments/1156769/view.html
here's my approach.
the key is that you know the formula for the X & Y position of the projectile over time as a function of the initial velocity, and the initial velocity (X & Y) is a function of the angle and the speed.
You can use all that to work backwards to get the speed.
![alt text][1]
[1]: /storage/temp/66173-img-8389.jpgFri, 18 Mar 2016 00:53:05 GMTelenzilComment by elenzil
http://answers.unity.com/comments/1156756/view.html
so the launch position and the launch target are fixed, as well as the launch angle, and you need to calculate the launch speed ?Fri, 18 Mar 2016 00:10:27 GMTelenzilComment by jebemti
http://answers.unity.com/comments/1156733/view.html
I really doubt there is someone mathematically skilled around here. You'll be better off trying on your own :DThu, 17 Mar 2016 23:03:51 GMTjebemti