A class defining a vector.
More...
#include <Vector.hpp>
A class defining a vector.
◆ Vector()
meshkernel::Vector::Vector |
( |
const double |
x, |
|
|
const double |
y |
|
) |
| |
|
inline |
Class constructor.
- Parameters
-
[in] | x | The x coordinate of the vector |
[in] | y | The y coordinate of the vector |
◆ length()
double meshkernel::Vector::length |
( |
| ) |
const |
|
inline |
Compute the length of the vector.
- Returns
- \( l = \sqrt (x^2 + y^2) \)
◆ lengthSquared()
double meshkernel::Vector::lengthSquared |
( |
| ) |
const |
|
inline |
Compute the length squared of the vector.
- Returns
- \( l = x^2 + y^2 \)
◆ normalise()
void meshkernel::Vector::normalise |
( |
| ) |
|
|
inline |
Normalise the vector in place.
- Note
- No check is made that the length is 0
◆ operator/=()
Inplace divide vector by scalar.
- Note
- No check is made that the divisor is 0
◆ x() [1/2]
double& meshkernel::Vector::x |
( |
| ) |
|
|
inline |
Gets the x coordinate of the vector.
- Returns
- x The x coordinate of the vector
◆ x() [2/2]
double meshkernel::Vector::x |
( |
| ) |
const |
|
inline |
Gets the x coordinate of the vector.
- Returns
- x The x coordinate of the vector
◆ y() [1/2]
double& meshkernel::Vector::y |
( |
| ) |
|
|
inline |
Gets the y coordinate of the vector.
- Returns
- x The y coordinate of the vector
◆ y() [2/2]
double meshkernel::Vector::y |
( |
| ) |
const |
|
inline |
Gets the y coordinate of the vector.
- Returns
- x The y coordinate of the vector
The documentation for this class was generated from the following file:
- /home/runner/work/MeshKernel/MeshKernel/libs/MeshKernel/include/MeshKernel/Vector.hpp