Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
PositionVector3D.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4 /**********************************************************************
5 * *
6 * Copyright (c) 2005 , LCG ROOT MathLib Team *
7 * *
8 * *
9 **********************************************************************/
10
11// Header file for class PositionVector3D
12//
13// Created by: Lorenzo Moneta at Mon May 30 15:25:04 2005
14//
15// Last update: $Id$
16//
17#ifndef ROOT_Math_GenVector_PositionVector3D
18#define ROOT_Math_GenVector_PositionVector3D 1
19
21
23
25
27
29
30
31#include <cassert>
32
33namespace ROOT {
34
35 namespace Math {
36
37
38//__________________________________________________________________________________________
39 /**
40 Class describing a generic position vector (point) in 3 dimensions.
41 This class is templated on the type of Coordinate system.
42 One example is the XYZPoint which is a vector based on
43 double precision x,y,z data members by using the
44 ROOT::Math::Cartesian3D<double> Coordinate system.
45 The class is having also an extra template parameter, the coordinate system tag,
46 to be able to identify (tag) vector described in different reference coordinate system,
47 like global or local coordinate systems.
48
49 @ingroup GenVector
50
51 @sa Overview of the @ref GenVector "physics vector library"
52 */
53
54 template <class CoordSystem, class Tag = DefaultCoordinateSystemTag >
56
57 public:
58
59 typedef typename CoordSystem::Scalar Scalar;
60 typedef CoordSystem CoordinateType;
62
63 // ------ ctors ------
64
65 /**
66 Default constructor. Construct an empty object with zero values
67 */
68
69 constexpr PositionVector3D() : fCoordinates() { }
70
71 /**
72 Construct from three values of type <em>Scalar</em>.
73 In the case of a XYZPoint the values are x,y,z
74 In the case of a polar vector they are r,theta,phi
75 */
76 constexpr PositionVector3D(const Scalar & a, const Scalar & b, const Scalar & c) :
77 fCoordinates ( a , b, c) { }
78
79 /**
80 Construct from a position vector expressed in different
81 coordinates, or using a different Scalar type
82 */
83 template <class T>
84 explicit constexpr PositionVector3D( const PositionVector3D<T,Tag> & v) :
85 fCoordinates ( v.Coordinates() ) { }
86
87 /**
88 Construct from an arbitrary displacement vector
89 */
90 template <class T>
91 explicit constexpr PositionVector3D( const DisplacementVector3D<T,Tag> & p) :
92 fCoordinates ( p.Coordinates() ) { }
93
94 /**
95 Construct from a foreign 3D vector type, for example, Hep3Vector
96 Precondition: v must implement methods x(), y() and z()
97 */
98 template <class ForeignVector>
99 explicit constexpr PositionVector3D( const ForeignVector & v) :
100 fCoordinates ( Cartesian3D<Scalar>( v.x(), v.y(), v.z() ) ) { }
101
102#ifdef LATER
103 /**
104 construct from a generic linear algebra vector of at least size 3
105 implementing operator []. This could be also a C array
106 \par v LAVector
107 \par index0 index where coordinates starts (typically zero)
108 It works for all Coordinates types,
109 ( x= v[index0] for Cartesian and r=v[index0] for Polar )
110 */
111 template <class LAVector>
112 PositionVector3D(const LAVector & v, size_t index0 ) {
113 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
114 }
115#endif
116
117 // compiler-generated copy ctor and dtor are fine.
118
119 // ------ assignment ------
120
121 /**
122 Assignment operator from a position vector of arbitrary type
123 */
124 template <class OtherCoords>
128 return *this;
129 }
130
131 /**
132 Assignment operator from a displacement vector of arbitrary type
133 */
134 template <class OtherCoords>
138 return *this;
139 }
140
141 /**
142 Assignment from a foreign 3D vector type, for example, Hep3Vector
143 Precondition: v must implement methods x(), y() and z()
144 */
145 template <class ForeignVector>
146 PositionVector3D & operator= ( const ForeignVector & v) {
147 SetXYZ( v.x(), v.y(), v.z() );
148 return *this;
149 }
150
151#ifdef LATER
152 /**
153 assign from a generic linear algebra vector of at least size 3
154 implementing operator [].
155 \par v LAVector
156 \par index0 index where coordinates starts (typically zero)
157 It works for all Coordinates types,
158 ( x= v[index0] for Cartesian and r=v[index0] for Polar )
159 */
160 template <class LAVector>
161 PositionVector3D & assignFrom(const LAVector & v, size_t index0 = 0) {
162 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
163 return *this;
164 }
165#endif
166
167 /**
168 Retrieve a copy of the coordinates object
169 */
170 const CoordSystem & Coordinates() const {
171 return fCoordinates;
172 }
173
174 /**
175 Set internal data based on a C-style array of 3 Scalar numbers
176 */
178 { fCoordinates.SetCoordinates(src); return *this; }
179
180 /**
181 Set internal data based on 3 Scalar numbers
182 */
184 { fCoordinates.SetCoordinates(a, b, c); return *this; }
185
186 /**
187 Set internal data based on 3 Scalars at *begin to *end
188 */
189 template <class IT>
191 { IT a = begin; IT b = ++begin; IT c = ++begin;
192 (void)end;
193 assert (++begin==end);
194 SetCoordinates (*a,*b,*c);
195 return *this;
196 }
197
198 /**
199 get internal data into 3 Scalar numbers
200 */
201 void GetCoordinates( Scalar& a, Scalar& b, Scalar& c ) const
202 { fCoordinates.GetCoordinates(a, b, c); }
203
204 /**
205 get internal data into a C-style array of 3 Scalar numbers
206 */
207 void GetCoordinates( Scalar dest[] ) const
208 { fCoordinates.GetCoordinates(dest); }
209
210 /**
211 get internal data into 3 Scalars at *begin to *end (3 past begin)
212 */
213 template <class IT>
214 void GetCoordinates( IT begin, IT end ) const
215 { IT a = begin; IT b = ++begin; IT c = ++begin;
216 (void)end;
217 assert (++begin==end);
218 GetCoordinates (*a,*b,*c);
219 }
220
221 /**
222 get internal data into 3 Scalars at *begin
223 */
224 template <class IT>
225 void GetCoordinates( IT begin ) const {
226 Scalar a = Scalar(0);
227 Scalar b = Scalar(0);
228 Scalar c = Scalar(0);
229 GetCoordinates(a, b, c);
230 *begin++ = a;
231 *begin++ = b;
232 *begin = c;
233 }
234
235 /**
236 set the values of the vector from the cartesian components (x,y,z)
237 (if the vector is held in polar or cylindrical eta coordinates,
238 then (x, y, z) are converted to that form)
239 */
241 fCoordinates.SetXYZ(a,b,c);
242 return *this;
243 }
244
245 // ------------------- Equality -----------------
246
247 /**
248 Exact equality
249 */
250 bool operator==(const PositionVector3D & rhs) const {
251 return fCoordinates==rhs.fCoordinates;
252 }
253 bool operator!= (const PositionVector3D & rhs) const {
254 return !(operator==(rhs));
255 }
256
257 // ------ Individual element access, in various coordinate systems ------
258
259 /**
260 Dimension
261 */
262 unsigned int Dimension() const
263 {
264 return fDimension;
265 };
266
267 /**
268 Cartesian X, converting if necessary from internal coordinate system.
269 */
270 Scalar X() const { return fCoordinates.X(); }
271
272 /**
273 Cartesian Y, converting if necessary from internal coordinate system.
274 */
275 Scalar Y() const { return fCoordinates.Y(); }
276
277 /**
278 Cartesian Z, converting if necessary from internal coordinate system.
279 */
280 Scalar Z() const { return fCoordinates.Z(); }
281
282 /**
283 Polar R, converting if necessary from internal coordinate system.
284 */
285 Scalar R() const { return fCoordinates.R(); }
286
287 /**
288 Polar theta, converting if necessary from internal coordinate system.
289 */
290 Scalar Theta() const { return fCoordinates.Theta(); }
291
292 /**
293 Polar phi, converting if necessary from internal coordinate system.
294 */
295 Scalar Phi() const { return fCoordinates.Phi(); }
296
297 /**
298 Polar eta, converting if necessary from internal coordinate system.
299 */
300 Scalar Eta() const { return fCoordinates.Eta(); }
301
302 /**
303 Cylindrical transverse component rho
304 */
305 Scalar Rho() const { return fCoordinates.Rho(); }
306
307 // ----- Other fundamental properties -----
308
309 /**
310 Magnitute squared ( r^2 in spherical coordinate)
311 */
312 Scalar Mag2() const { return fCoordinates.Mag2();}
313
314 /**
315 Transverse component squared (rho^2 in cylindrical coordinates.
316 */
317 Scalar Perp2() const { return fCoordinates.Perp2();}
318
319 // It is physically meaningless to speak of the unit vector corresponding
320 // to a point.
321
322 // ------ Setting individual elements present in coordinate system ------
323
324 /**
325 Change X - Cartesian3D coordinates only
326 */
328
329 /**
330 Change Y - Cartesian3D coordinates only
331 */
333
334 /**
335 Change Z - Cartesian3D coordinates only
336 */
338
339 /**
340 Change R - Polar3D coordinates only
341 */
343
344 /**
345 Change Theta - Polar3D coordinates only
346 */
347 PositionVector3D<CoordSystem, Tag>& SetTheta (Scalar ang) { fCoordinates.SetTheta(ang); return *this;}
348
349 /**
350 Change Phi - Polar3D or CylindricalEta3D coordinates
351 */
353
354 /**
355 Change Rho - CylindricalEta3D coordinates only
356 */
358
359 /**
360 Change Eta - CylindricalEta3D coordinates only
361 */
362 PositionVector3D<CoordSystem, Tag>& SetEta (Scalar etaval) { fCoordinates.SetEta(etaval); return *this;}
363
364 // ------ Operations combining two vectors ------
365 // need to specialize to exclude those with a different tags
366
367 /**
368 Return the scalar (Dot) product of this with a displacement vector in
369 any coordinate system, but with the same tag
370 */
371 template< class OtherCoords >
373 return X()*v.x() + Y()*v.y() + Z()*v.z();
374 }
375
376
377 /**
378 Return vector (Cross) product of this point with a displacement, as a
379 point vector in this coordinate system of the first.
380 */
381 template< class OtherCoords >
384 result.SetXYZ ( Y()*v.z() - v.y()*Z(),
385 Z()*v.x() - v.z()*X(),
386 X()*v.y() - v.x()*Y() );
387 return result;
388 }
389
390 // The Dot and Cross products of a pair of point vectors are physically
391 // meaningless concepts and thus are defined as private methods
392
393 // It is physically meaningless to speak of the Unit vector corresponding
394 // to a point.
395
396
397 /**
398 Self Addition with a displacement vector.
399 */
400 template <class OtherCoords>
402 {
403 SetXYZ( X() + v.X(), Y() + v.Y(), Z() + v.Z() );
404 return *this;
405 }
406
407 /**
408 Self Difference with a displacement vector.
409 */
410 template <class OtherCoords>
412 {
413 SetXYZ( X() - v.X(), Y() - v.Y(), Z() - v.Z() );
414 return *this;
415 }
416
417 /**
418 multiply this vector by a scalar quantity
419 */
421 fCoordinates.Scale(a);
422 return *this;
423 }
424
425 /**
426 divide this vector by a scalar quantity
427 */
429 fCoordinates.Scale(1/a);
430 return *this;
431 }
432
433 // The following methods (v*a and v/a) could instead be free functions.
434 // They were moved into the class to solve a problem on AIX.
435 /**
436 Multiply a vector by a real number
437 */
439 PositionVector3D tmp(*this);
440 tmp *= a;
441 return tmp;
442 }
443
444 /**
445 Division of a vector with a real number
446 */
448 PositionVector3D tmp(*this);
449 tmp /= a;
450 return tmp;
451 }
452
453 // Limited backward name compatibility with CLHEP
454
455 Scalar x() const { return fCoordinates.X(); }
456 Scalar y() const { return fCoordinates.Y(); }
457 Scalar z() const { return fCoordinates.Z(); }
458 Scalar r() const { return fCoordinates.R(); }
459 Scalar theta() const { return fCoordinates.Theta(); }
460 Scalar phi() const { return fCoordinates.Phi(); }
461 Scalar eta() const { return fCoordinates.Eta(); }
462 Scalar rho() const { return fCoordinates.Rho(); }
463 Scalar mag2() const { return fCoordinates.Mag2(); }
464 Scalar perp2() const { return fCoordinates.Perp2(); }
465
466 private:
467
468 CoordSystem fCoordinates;
469 static constexpr unsigned int fDimension = CoordinateType::Dimension;
470
471 // Prohibited methods
472
473 // this should not compile (if from a vector or points with different tag
474
475 template <class OtherCoords, class OtherTag>
477
478 template <class OtherCoords, class OtherTag>
480
481 template <class OtherCoords, class OtherTag>
483
484 template <class OtherCoords, class OtherTag>
486
487 template <class OtherCoords, class OtherTag>
489
490 template <class OtherCoords, class OtherTag>
492
493// /**
494// Dot product of two position vectors is inappropriate
495// */
496// template <class T2, class U>
497// PositionVector3D Dot( const PositionVector3D<T2,U> & v) const;
498
499// /**
500// Cross product of two position vectors is inappropriate
501// */
502// template <class T2, class U>
503// PositionVector3D Cross( const PositionVector3D<T2,U> & v) const;
504
505
506
507 };
508
509// ---------- PositionVector3D class template ends here ----------------
510// ---------------------------------------------------------------------
511
512 /**
513 Multiplication of a position vector by real number a*v
514 */
515 template <class CoordSystem, class U>
516 inline
520 return v *= a;
521 // Note - passing v by value and using operator *= may save one
522 // copy relative to passing v by const ref and creating a temporary.
523 }
524
525 /**
526 Difference between two PositionVector3D vectors.
527 The result is a DisplacementVector3D.
528 The (coordinate system) type of the returned vector is defined to
529 be identical to that of the first position vector.
530 */
531
532 template <class CoordSystem1, class CoordSystem2, class U>
533 inline
534 DisplacementVector3D<CoordSystem1,U>
538 v1.X()-v2.X(), v1.Y()-v2.Y(),v1.Z()-v2.Z() )
539 );
540 }
541
542 /**
543 Addition of a PositionVector3D and a DisplacementVector3D.
544 The return type is a PositionVector3D,
545 of the same (coordinate system) type as the input PositionVector3D.
546 */
547 template <class CoordSystem1, class CoordSystem2, class U>
548 inline
549 PositionVector3D<CoordSystem2,U>
552 return p1 += v2;
553 }
554
555 /**
556 Addition of a DisplacementVector3D and a PositionVector3D.
557 The return type is a PositionVector3D,
558 of the same (coordinate system) type as the input PositionVector3D.
559 */
560 template <class CoordSystem1, class CoordSystem2, class U>
561 inline
562 PositionVector3D<CoordSystem2,U>
565 return p2 += v1;
566 }
567
568 /**
569 Subtraction of a DisplacementVector3D from a PositionVector3D.
570 The return type is a PositionVector3D,
571 of the same (coordinate system) type as the input PositionVector3D.
572 */
573 template <class CoordSystem1, class CoordSystem2, class U>
574 inline
575 PositionVector3D<CoordSystem2,U>
578 return p1 -= v2;
579 }
580
581 // Scaling of a position vector with a real number is not physically meaningful
582
583 // ------------- I/O to/from streams -------------
584
585 template <
586 class char_t, class traits_t, class T, class U,
587 typename std::enable_if<std::is_arithmetic<typename PositionVector3D<T, U>::Scalar>::value>::type * = nullptr>
588 std::basic_ostream<char_t, traits_t> &operator<<(std::basic_ostream<char_t, traits_t> &os,
589 PositionVector3D<T, U> const &v)
590 {
591 if (os) {
592
593 typename T::Scalar a = 0;
594 typename T::Scalar b = 0;
595 typename T::Scalar c = 0;
596 v.GetCoordinates(a, b, c);
597
600 typedef GenVector_detail::BitReproducible BR;
601 BR::Output(os, a);
602 BR::Output(os, b);
603 BR::Output(os, c);
604 } else {
607 }
608 }
609 return os;
610 } // op<< <>()
611
612 template <
613 class char_t, class traits_t, class T, class U,
614 typename std::enable_if<!std::is_arithmetic<typename PositionVector3D<T, U>::Scalar>::value>::type * = nullptr>
615 std::basic_ostream<char_t, traits_t> &operator<<(std::basic_ostream<char_t, traits_t> &os,
616 PositionVector3D<T, U> const &v)
617 {
618 if (os) {
619 os << "{ ";
620 for (std::size_t i = 0; i < PositionVector3D<T, U>::Scalar::Size; ++i) {
621 os << "(" << v.x()[i] << "," << v.y()[i] << "," << v.z()[i] << ") ";
622 }
623 os << "}";
624 }
625 return os;
626 } // op<< <>()
627
628 template< class char_t, class traits_t, class T, class U >
629 inline
630 std::basic_istream<char_t,traits_t> &
631 operator >> ( std::basic_istream<char_t,traits_t> & is
633 )
634 {
635 if( !is ) return is;
636
637 typename T::Scalar a, b, c;
638
642 BR::Input(is, a);
643 BR::Input(is, b);
644 BR::Input(is, c);
645 }
646 else {
648 detail::require_delim( is, detail::sep ); is >> b;
649 detail::require_delim( is, detail::sep ); is >> c;
651 }
652
653 if( is )
654 v.SetCoordinates(a, b, c);
655 return is;
656
657 } // op>> <>()
658
659
660
661
662 } // namespace Math
663
664} // namespace ROOT
665
666
667#endif /* ROOT_Math_GenVector_PositionVector3D */
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
Definition TBuffer.h:397
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
Definition Cartesian3D.h:46
Class describing a generic displacement vector in 3 dimensions.
Class describing a generic position vector (point) in 3 dimensions.
PositionVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
unsigned int Dimension() const
Dimension.
PositionVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
constexpr PositionVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
bool operator!=(const PositionVector3D &rhs) const
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
PositionVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
PositionVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
PositionVector3D operator*(Scalar a) const
Multiply a vector by a real number.
PositionVector3D & operator=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D & operator=(const PositionVector3D< OtherCoords, Tag > &v)
Assignment operator from a position vector of arbitrary type.
PositionVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
constexpr PositionVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D & operator+=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
PositionVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
constexpr PositionVector3D(const PositionVector3D< T, Tag > &v)
Construct from a position vector expressed in different coordinates, or using a different Scalar type...
constexpr PositionVector3D(const Scalar &a, const Scalar &b, const Scalar &c)
Construct from three values of type Scalar.
PositionVector3D< CoordSystem, Tag > & SetXYZ(Scalar a, Scalar b, Scalar c)
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or...
PositionVector3D operator/(Scalar a) const
Division of a vector with a real number.
constexpr PositionVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
bool operator==(const PositionVector3D &rhs) const
Exact equality.
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
PositionVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
Scalar Rho() const
Cylindrical transverse component rho.
PositionVector3D Cross(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return vector (Cross) product of this point with a displacement, as a point vector in this coordinate...
PositionVector3D & operator=(const PositionVector3D< OtherCoords, OtherTag > &)
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
PositionVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
PositionVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (Dot) product of this with a displacement vector in any coordinate system,...
PositionVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
PositionVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars at *begin
static constexpr unsigned int fDimension
const CoordSystem & Coordinates() const
Retrieve a copy of the coordinates object.
constexpr PositionVector3D()
Default constructor.
constexpr PositionVector3D(const DisplacementVector3D< T, Tag > &p)
Construct from an arbitrary displacement vector.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Namespace for new Math classes and functions.
double T(double x)
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
Definition GenVectorIO.h:54
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
Definition GenVectorIO.h:74
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...