Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 841 Bytes

File metadata and controls

21 lines (11 loc) · 841 Bytes

Parabolic-Object-Movement

Here, I have moved a object in a parabolic path using equation Y = aX2 + bX + c

Steps:

1. Take three points: starting point, ending point and a point that lies in the path. For my case, points are (10, 100), (70, 80) and (50, 20) respectively.

2. Put these all points in equation above and generate three equations as:

   100 = a*102 + b*10 + c ..............(i)

   80 = a*702 + b*70 + c ..............(ii)

   20 = a*502 + b*50 + c ..............(iii)

3. Solve the above three equations to get the value of constants a, b and c

4. Then equation becomes Y = (1/12)X2 - (7)X + (485/30)

5. Use this equation and use loop to move object as shown in sample code.