Provides functions for linear interpolation on three-dimensional data.
More...
#include <string>
#include <vector>
Go to the source code of this file.
|
double | lin_interp (double x_1, double y_1, double x_2, double y_2, double x) |
| Performs linear interpolation. More...
|
|
int | find (vector< double > &arr, double v) |
| Finds the array index for a value closest to the given value. More...
|
|
vector< double > | extractColumn (vector< vector< double >> &mat, int j) |
| Extracts a column from a 2D matrix. More...
|
|
double | interpY (string filename, double x, double z) |
| Linearly interpolates a y value at given x and z values. More...
|
|
double | interpZ (string filename, double x, double y) |
| Linearly interpolates a z value at given x and y values. More...
|
|
Provides functions for linear interpolation on three-dimensional data.
- Author
- Nikitha Krithnan and W. Spencer Smith
- Note
- Generated by Drasil v0.1-alpha
◆ extractColumn()
vector<double> extractColumn |
( |
vector< vector< double >> & |
mat, |
|
|
int |
j |
|
) |
| |
Extracts a column from a 2D matrix.
- Parameters
-
mat | matrix from which column will be extracted |
j | index |
- Returns
- column of the given matrix at the given index
◆ find()
int find |
( |
vector< double > & |
arr, |
|
|
double |
v |
|
) |
| |
Finds the array index for a value closest to the given value.
- Parameters
-
arr | array in which value should be found |
v | value whose index will be found |
- Returns
- index of given value in given array
◆ interpY()
double interpY |
( |
string |
filename, |
|
|
double |
x, |
|
|
double |
z |
|
) |
| |
Linearly interpolates a y value at given x and z values.
- Parameters
-
filename | name of file with x y and z data |
x | x-coordinate to interpolate at |
z | z-coordinate to interpolate at |
- Returns
- y value interpolated at given x and z values
◆ interpZ()
double interpZ |
( |
string |
filename, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
Linearly interpolates a z value at given x and y values.
- Parameters
-
filename | name of file with x y and z data |
x | x-coordinate to interpolate at |
y | y-coordinate to interpolate at |
- Returns
- z value interpolated at given x and y values
◆ lin_interp()
double lin_interp |
( |
double |
x_1, |
|
|
double |
y_1, |
|
|
double |
x_2, |
|
|
double |
y_2, |
|
|
double |
x |
|
) |
| |
Performs linear interpolation.
- Parameters
-
x_1 | lower x-coordinate |
y_1 | lower y-coordinate |
x_2 | upper x-coordinate |
y_2 | upper y-coordinate |
x | x-coordinate to interpolate at |
- Returns
- y value interpolated at given x value