|
|
| Vector2 () |
| | Empty.
|
| |
| | Vector2 (const double &) |
| | Create a vector with the same real coordinates.
|
| |
|
| Vector2 (const double &, const double &) |
| | Create a vector with argument coordinates.
|
| |
|
| Vector2 (const Vector &) |
| | Create a two dimension vector from another three dimension vector.
|
| |
|
double & | operator[] (int) |
| | Gets the i-th coordinate of vector.
|
| |
|
constexpr double | operator[] (int) const |
| | Returns the i-th coordinate of vector.
|
| |
|
Vector2 | Orthogonal () const |
| | Returns a direct orthogonal vector.
|
| |
|
Vector2 | operator+ () const |
| | Overloaded.
|
| |
|
Vector2 | operator- () const |
| | Overloaded.
|
| |
|
Vector2 & | operator+= (const Vector2 &) |
| | Destructive addition.
|
| |
|
Vector2 & | operator-= (const Vector2 &) |
| | Destructive subtraction.
|
| |
|
Vector2 & | operator*= (const Vector2 &) |
| | Destructively scale a vector by another vector.
|
| |
|
Vector2 & | operator/= (const Vector2 &) |
| | Destructively divide the components of a vector by another vector.
|
| |
|
Vector2 & | operator*= (double) |
| | Destructive scalar multiply.
|
| |
|
Vector2 & | operator/= (double) |
| | Destructive division by a scalar.
|
| |
| double | Max () const |
| | Compute the maximum component of a vector.
|
| |
| int | MaxIndex () const |
| | Compute the index of the maximum component of a vector.
|
| |
| int | MinIndex () const |
| | Compute the index of the minimum component of a vector.
|
| |
| QString | ToGLSL () const |
| | Return QString of the form 'vec2(x, y)' that write the vector in GLSL.
|
| |
| Vector | ToVector (const double &=0.0) const |
| | Convert a Vector2 to a Vector.
|
| |
| Vector2 | Inverse () const |
| | Inverse of a vector.
|
| |
| int | Quadrant (const Vector2 &) const |
| | Computes quadrant index of a vector with respect to the vector object.
|
| |
| QString | ToString (int=6) const |
| | Create a QString form a vector.
|
| |
| Vector2 | Scaled (const Vector2 &) const |
| | Scales the vector.
|
| |
| void | Scale (const Vector2 &) |
| | Scales the vector.
|
| |
|
Vector2 | Sort () const |
| | Sort the terms of the vector into ascending order.
|
| |
| double | Angle (const Vector2 &) const |
| | Compute the angle between two vectors.
|
| |
| double | Angle () const |
| | Compute the angle of a vector.
|
| |
| Vector2 | Floor () const |
| | Compute the numerator part of the coordinates.
|
| |
| Vector2 | Fract () const |
| | Compute the fractional part of the coordinates.
|
| |
|
| static bool | Equal (const Vector2 &, const Vector2 &, const double &=0.0001) |
| | Test if two vectors are almost equal.
|
| |
|
static Vector2 | Min (const Vector2 &, const Vector2 &) |
| | Return a vector with coordinates set to the minimum coordinates of the two argument vectors.
|
| |
|
static Vector2 | Max (const Vector2 &, const Vector2 &) |
| | Return a vector with coordinates set to the maximum coordinates of the two argument vectors.
|
| |
| static void | SetMinMax (const Vector2 &, Vector2 &, Vector2 &) |
| | Update the minimum and maximum values given a vector.
|
| |
| static Vector2 | Mod (const Vector2 &, const Vector2 &) |
| | Modulo of two vectors.
|
| |
| static Vector2 | Lerp (const Vector2 &, const Vector2 &, const double &) |
| | Linear interpolation between two vectors.
|
| |
| static Vector2 | Bilinear (const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const double &, const double &) |
| | Bi-linear interpolation between four vectors.
|
| |
| static Vector2 | FromString (QString) |
| | Creates a vector from a QString.
|
| |
| static Vector2 | Polar (const double &) |
| | Creates a vector given polar coordinates.
|
| |
| static Vector2 | Solve (const Vector2 &, const Vector2 &, const double &, const double &) |
| | Compute the point on a segment such that the linear function satisfies f(a)=va and f(b)=vb.
|
| |
| static bool | Clockwise (const Vector2 &, const Vector2 &, const Vector2 &) |
| | Returns true if the three points make a clockwise turn.
|
| |
|
|
bool | operator> (const Vector2 &u, const Vector2 &v) |
| | Compare two vectors.
|
| |
|
bool | operator< (const Vector2 &u, const Vector2 &v) |
| | Compare two vectors.
|
| |
|
bool | operator>= (const Vector2 &u, const Vector2 &v) |
| | Overloaded.
|
| |
|
bool | operator<= (const Vector2 &u, const Vector2 &v) |
| | Overloaded.
|
| |
|
Vector2 | operator+ (const Vector2 &u, const Vector2 &v) |
| | Adds up two vectors.
|
| |
|
Vector2 | operator- (const Vector2 &u, const Vector2 &v) |
| | Difference between two vectors.
|
| |
| double | operator* (const Vector2 &u, const Vector2 &v) |
| | Dot product between two vectors.
|
| |
|
Vector2 | operator* (const Vector2 &u, double a) |
| | Right multiply by a scalar.
|
| |
|
Vector2 | operator* (double a, const Vector2 &v) |
| | Left multiply by a scalar.
|
| |
|
Vector2 | operator/ (const Vector2 &u, double a) |
| | Left divide by a scalar.
|
| |
|
double | operator/ (const Vector2 &u, const Vector2 &v) |
| | Cross productof two vectors. Note that the derminant of a 2-square matrix is the cross product of its two colum vectors.
|
| |
|
bool | operator== (const Vector2 &u, const Vector2 &v) |
| | Strong equality test.
|
| |
|
bool | operator!= (const Vector2 &u, const Vector2 &v) |
| | Strong difference test.
|
| |
| double | Norm (const Vector2 &u) |
| | Compute the Euclidean norm of a vector.
|
| |
| double | SquaredNorm (const Vector2 &u) |
| | Compute the squared Euclidean norm of a vector.
|
| |
| double | NormInfinity (const Vector2 &u) |
| | Compute the infinity norm of a vector.
|
| |
| void | Normalize (Vector2 &u) |
| | Normalize a two dimensional vector.
|
| |
| Vector2 | Normalized (const Vector2 &u) |
| | Return a Normalized a vector, computing the inverse of its norm and scaling the components.
|
| |
| double | Sine (const Vector2 &u, const Vector2 &v) |
| | Returns the sine of two vectors.
|
| |
| double | Cosine (const Vector2 &u, const Vector2 &v) |
| | Returns the positive cosine of two vectors.
|
| |
|
Vector2 | Abs (const Vector2 &u) |
| | Computes the absolute value of a vector.
|
| |
| void | Swap (Vector2 &a, Vector2 &b) |
| | Swap two vectors.
|
| |
| Vector2 | Clamp (const Vector2 &x, const Vector2 &a, const Vector2 &b) |
| | Clamp a Vector2 between two bounds.
|
| |
| double | WhichSide (const Vector2 &p, const Vector2 &a, const Vector2 &b) |
| | Compute the position of a point with respect to a line.
|
| |
| std::ostream & | operator<< (std::ostream &s, const Vector2 &u) |
| | Overloaded output-stream operator.
|
| |
Vectors in two dimensions.
This class implements most operators and member functions as for Vector class.