We get the co-ordinates of a projectile
at t1, (a,b)
at t2 (c,d)
at t3, (e,f)
and so on as required.
Write a program in C++ to calculate equation of trajectory of projectile..

3
Contributors
4
Replies
21
Views
4 Years
Discussion Span
Last Post by Rahul47

Hi PratyushTheGreat, welcome at DaniWeb!
What you need is linear regression for quadratic curve fitting (The trajecory of a projectile is parabolic.)
The link has an explanation and code in C#, but it should be fairly easy to google something in C++ I guess.

I think you will have to specify angle of projection too.

Well get the input . . . put into algorithm and then you have the output . . .provided that you know the algorithm . . .

Am too lazy to write an algorithm for you .. . so you better write your own and post it.

Good Luck.

I think you will have to specify angle of projection too

I don't think so. It is the other way around! Once you have calculated the equation(3 points is the absolute minimum here) you could calculate that angle if you wanted to.

3 points is the absolute minimum here)

Dont you think with angle of projection it will be easier.
If only three points are given then that is not a problem either.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.