rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0

Two-dimensional specialisation of Vector. More...

#include <Vector2.hh>

Inheritance diagram for Rivet::Vector2:
Rivet::Vector< 2 >

Public Types

using EVector = RivetEigen::Matrix< double, N, 1 >
 Vector.
 

Public Member Functions

template<typename V2TYPE >
 Vector2 (const V2TYPE &other)
 
 Vector2 (const Vector< 2 > &other)
 
 Vector2 (double x, double y)
 
double x () const
 
double y () const
 
Vector2setX (double x)
 
Vector2setY (double y)
 
double dot (const Vector2 &v) const
 Dot-product with another vector.
 
double angle (const Vector2 &v) const
 Angle in radians to another vector.
 
Vector2 unitVec () const
 Unit-normalized version of this vector.
 
Vector2 unit () const
 Synonym for unitVec.
 
Vector2operator*= (const double a)
 
Vector2operator/= (const double a)
 
Vector2operator+= (const Vector2 &v)
 
Vector2operator-= (const Vector2 &v)
 
Vector2 operator- () const
 
const double & get (const size_t index) const
 
double & get (const size_t index)
 
const double & operator[] (const size_t index) const
 Direct access to vector elements by index.
 
double & operator[] (const size_t index)
 Direct access to vector elements by index.
 
Vector< N > & set (const size_t index, const double value)
 Set indexed value.
 
constexpr size_t size () const
 Vector dimensionality.
 
bool isZero (double tolerance=1E-5) const
 Check for nullness, allowing for numerical precision.
 
double mod2 () const
 Calculate the modulus-squared of a vector. \( \sum_{i=1}^N x_i^2 \).
 
double mod () const
 Calculate the modulus of a vector. \( \sqrt{\sum_{i=1}^N x_i^2} \).
 
bool operator== (const Vector< N > &a) const
 
bool operator!= (const Vector< N > &a) const
 

Static Public Member Functions

static Vector2 mkX ()
 
static Vector2 mkY ()
 

Friends

Vector2 multiply (const double, const Vector2 &)
 
Vector2 multiply (const Vector2 &, const double)
 
Vector2 add (const Vector2 &, const Vector2 &)
 
Vector2 subtract (const Vector2 &, const Vector2 &)
 

Detailed Description

Two-dimensional specialisation of Vector.


The documentation for this class was generated from the following file:
  • /Users/chrisg/software/rivet/include/Rivet/Math/Vector2.hh