1 #ifndef GeometryVector_oldBasic2DVector_h
2 #define GeometryVector_oldBasic2DVector_h
3 #if ( defined(IN_DICTBUILD) || defined(__CINT__) ) && !defined(__REFLEX__)
44 template <
class Other>
51 #if defined(USE_EXTVECT)
59 #elif defined(USE_SSEVECT)
99 return my_mag == 0 ? *
this : *
this / my_mag;
147 return x()*v.
x() +
y()*v.
y();
162 return x()*v.
y() -
y()*v.
x();
172 namespace geometryDetails {
173 std::ostream &
print2D(std::ostream&
s,
double x,
double y);
179 inline std::ostream & operator<<( std::ostream& s, const Basic2DVector<T>&
v) {
185 template <
class T,
class U>
189 return RT(a.
x()+b.
x(), a.
y()+b.
y());
192 template <
class T,
class U>
196 return RT(a.
x()-b.
x(), a.
y()-b.
y());
209 template <
class T,
class U>
212 return v1.
x()*v2.
x() + v1.
y()*v2.
y();
218 template <
class T,
class Scalar>
220 T t =
static_cast<T>(
s);
225 template <
class T,
class Scalar>
227 T t =
static_cast<T>(
s);
234 template <
class T,
class Scalar>
236 T t =
static_cast<T>(
s);
244 #endif // GeometryVector_Basic2DVector_h
Basic2DVector(const T &x, const T &y)
construct from cartesian coordinates
MatrixMeschach operator+(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
Basic2DVector(const Basic2DVector &p)
Copy constructor from same type. Should not be needed but for gcc bug 12685.
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.
MatrixMeschach operator-(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Basic2DVector operator-() const
Unary minus, returns a vector with components (-x(),-y(),-z())
T r() const
Radius, same as mag()
Basic2DVector(const Other &p)
Basic3DVector< long double > operator/(const Basic3DVector< long double > &v, S s)
Basic2DVector< double > Basic2DVectorD
Basic2DVector unit() const
Basic2DVector< float > Basic2DVectorF
Geom::Polar2Cartesian< T > Polar
Basic2DVector & operator*=(T t)
Scaling by a scalar value (multiplication)
Basic2DVector & operator/=(T t)
Scaling by a scalar value (division)
T dot(const Basic2DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::ostream & print2D(std::ostream &s, double x, double y)
Basic2DVector & operator+=(const Basic2DVector< U > &p)
T y() const
Cartesian y coordinate.
PreciseFloatType< T, U >::Type dot(const Basic2DVector< U > &v) const
Basic2DVector & operator-=(const Basic2DVector< U > &p)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T operator[](int i) const
Basic2DVector< T > MathVector
PreciseFloatType< T, U >::Type cross(const Basic2DVector< U > &v) const
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
T cross(const Basic2DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Geom::Phi< T > phi() const
T x() const
Cartesian x coordinate.