Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- #include <cstdlib>
- using namespace std;
- void readData (string fileName, vector<double> & flightPath, vector<double> & coLift) {
- ifstream inSS;
- inSS.open(fileName.c_str());
- int i = 0;
- if (!inSS) {
- cout << "File could not be opened" << endl;
- exit(1);
- }
- while (inSS >> flightPath.at(i)) {
- inSS >> coLift.at(i);
- i += 1;
- }
- flightPath.resize(i + 1);
- inSS.close();
- return;
- }
- //double interpolation (double flightAngle, const vector<double> & flightPath, const vector<double> & coLift);
- //bool isOrdered (const vector<double> & flightPath);
- //void reorder (vector<double & flightPath, vector<double> & coLift);
- int main() {
- string fileName;
- double flightAngle;
- vector<double> flightPath;
- vector<double> coLift;
- cout << "Please enter wind tunnel data file name:" << endl;
- cin >> fileName;
- readData (fileName, flightPath, coLift);
- cout << flightPath.at(4) << " " << coLift.at(4);
- /* if (!isOrdered (flightPath)) {
- reorder(flightPath, coLift);
- }
- // ==> Checks if vector is in order, if not it reorders it.
- cout << "Please enter a flight-path angle:" << endl;
- cin >> flightAngle;
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement