Letβs denote this in the mathematical model ... Angle direction of the parabola is an input variable, the parabola crosses the x axis at 0 and the target point , height will be calculated.
The parabola will look like this: y = x*(ax)*b , where a determines the distance to the target point, b is a certain value that (with a ) affects the initial angle and height. We can calculate the angle through atan (x/y) in the center of the origin. And we know that a tangent is a derivative of a parabola. The derivative y' = a*b - 2*x*b , and in the center of the beginning y=0 and x=0 , and we get [derivative in origin center] = a*b . a predetermined as the distance to the target point, so Angle affected by the change in b : angle = atan(a*b) .
At this point, we have the parabola equation y = x*(ax)*b , the predetermined a=[distance to target point]*4 and the angle equation angle=atan(a*b) , where b is the input value. For instance:
- Distance to point 10 β
a=40 - user inputs 45 * β tan (45 *) = 1,
b = tan(45*)/a β b=1/40 - put these values ββin the equation
y = x*(ax)*b : y = x*(40-x)/40 and check ...
As for the maximum height, it is calculated from the equation a*x^2+b*x+c = 0 with the condition that =-b/2 . I think it should not be difficult to calculate on your own :)
source share