Answers for "Calculating force"
http://answers.unity.com/questions/1156051/calculating-force.html
The latest answers for the question "Calculating force"Answer 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 GMTelenzil