A class for 2D vector.
More...
#include <vec2d.h>
|
| Vec2d () |
|
| Vec2d (double const x_i, double const y_i) |
|
double | x () const |
|
double | y () const |
|
void | SetX (double x) |
|
void | SetY (double y) |
|
Vec2d | Perpendicular () const |
| Computes perpendicular Vector.
|
|
void | Add (Vec2d const &v) |
| Adds two vectors.
|
|
int | Divide (const double scalar) |
| Divide vector by a scalar.
|
|
double | Dot (Vec2d const &v) const |
| Computes dot product of two Vectors.
|
|
double | NormSqr () const |
| Returns square of Euclidean distance from origin.
|
|
double | Norm () const |
| Returns Euclidean distance from origin.
|
|
int | CosAngle (Vec2d const &v, double &ang) const |
| Gives cosine of the angle between this and Vector v.
|
|
double | DistSqr (Vec2d const &v) const |
| Gives the distance between the Vector and another Vector v.
|
|
double | Dist (Vec2d const &v) const |
|
void | DistTht (Vec2d const &v, double &d, double &tht) const |
| Computes distance and angle with another Vector (v-this)
|
|
Vec2d | operator+ (Vec2d const &vec) const |
|
Vec2d | operator- (Vec2d const &vec) const |
|
Vec2d | operator- () const |
|
Vec2d | operator/ (double const &scalar) const |
|
Vec2d | operator* (double const &scalar) const |
|
int | Normalize () |
|
A class for 2D vector.
Definition at line 45 of file vec2d.h.
◆ Vec2d() [1/2]
◆ Vec2d() [2/2]
Vec2d |
( |
double const | x_i, |
|
|
double const | y_i ) |
|
inline |
◆ Add()
void Add |
( |
Vec2d const & | v | ) |
|
|
inline |
Adds two vectors.
Definition at line 68 of file vec2d.h.
◆ CosAngle()
int CosAngle |
( |
Vec2d const & | v, |
|
|
double & | ang ) const |
|
inline |
Gives cosine of the angle between this and Vector v.
Definition at line 93 of file vec2d.h.
◆ Dist()
double Dist |
( |
Vec2d const & | v | ) |
const |
|
inline |
◆ DistSqr()
double DistSqr |
( |
Vec2d const & | v | ) |
const |
|
inline |
Gives the distance between the Vector and another Vector v.
Definition at line 100 of file vec2d.h.
◆ DistTht()
void DistTht |
( |
Vec2d const & | v, |
|
|
double & | d, |
|
|
double & | tht ) const |
|
inline |
Computes distance and angle with another Vector (v-this)
Definition at line 110 of file vec2d.h.
◆ Divide()
int Divide |
( |
const double | scalar | ) |
|
|
inline |
Divide vector by a scalar.
Definition at line 74 of file vec2d.h.
◆ Dot()
double Dot |
( |
Vec2d const & | v | ) |
const |
|
inline |
Computes dot product of two Vectors.
Definition at line 84 of file vec2d.h.
◆ Norm()
Returns Euclidean distance from origin.
Definition at line 90 of file vec2d.h.
◆ Normalize()
◆ NormSqr()
Returns square of Euclidean distance from origin.
Definition at line 87 of file vec2d.h.
◆ operator*()
Vec2d operator* |
( |
double const & | scalar | ) |
const |
|
inline |
◆ operator+()
◆ operator-() [1/2]
Vec2d operator- |
( |
| ) |
const |
|
inline |
◆ operator-() [2/2]
◆ operator/()
Vec2d operator/ |
( |
double const & | scalar | ) |
const |
|
inline |
◆ Perpendicular()
Vec2d Perpendicular |
( |
| ) |
const |
|
inline |
Computes perpendicular Vector.
Definition at line 61 of file vec2d.h.
◆ SetX()
◆ SetY()
◆ x()
◆ y()