Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. double interpolation (double flightAngle, const vector<double> & flightPath, const vector<double> & coLift) {
  2. int j;
  3. double answer;
  4. int size = static_cast<int> (flightPath.size());
  5.  
  6.  
  7. for (j = 0; j + 1 < size; ++j) {
  8. if (flightPath.at(j) > flightAngle) {
  9. break;
  10. }
  11. }
  12.  
  13. answer = coLift.at(j - 1) + ((flightAngle - flightPath.at(j - 1))) / (flightPath.at(j)
  14. - flightPath.at(j - 1)) * (coLift.at(j) - coLift.at(j - 1));
  15.  
  16. return answer;
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement