1 #ifndef GeometryVector_oldBasic2DVector_h
2 #define GeometryVector_oldBasic2DVector_h
3 #if defined(__CINT__) && !defined(__REFLEX__)
44 template <
class Other>
89 return my_mag == 0 ? *
this : *
this / my_mag;
137 return x()*v.
x() +
y()*v.
y();
152 return x()*v.
y() -
y()*v.
x();
162 namespace geometryDetails {
163 std::ostream &
print2D(std::ostream&
s,
double x,
double y);
169 inline std::ostream & operator<<( std::ostream& s, const Basic2DVector<T>&
v) {
175 template <
class T,
class U>
179 return RT(a.
x()+b.
x(), a.
y()+b.
y());
182 template <
class T,
class U>
186 return RT(a.
x()-b.
x(), a.
y()-b.
y());
199 template <
class T,
class U>
202 return v1.
x()*v2.
x() + v1.
y()*v2.
y();
208 template <
class T,
class Scalar>
210 T t =
static_cast<T>(
s);
215 template <
class T,
class Scalar>
217 T t =
static_cast<T>(
s);
224 template <
class T,
class Scalar>
226 T t =
static_cast<T>(
s);
234 #endif // GeometryVector_Basic2DVector_h
Basic2DVector(const T &x, const T &y)
construct from cartesian coordinates
Basic2DVector(mathSSE::Vec2< U > const &iv)
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 unit() const
Geom::Polar2Cartesian< T > Polar
Basic2DVector< float > Basic2DVectorF
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)
Basic2DVector(mathSSE::Vec4< U > const &iv)
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.
Basic2DVector< double > Basic2DVectorD
Geom::Phi< T > phi() const
T x() const
Cartesian x coordinate.