33 Vector Classes
44##############
55
6- There are two Vector classes available that are ``Vector4R `` and ``Vector3R ``.
6+ There are two vector classes available in Hydra, namely ``Vector4R `` and ``Vector3R ``.
77
88Vector4R
99========
1010
11- The Vector4R class is the wrapper of C++ Vector4R class. This class basically
12- deals with the vector of 4 particles. We have three types of constructors
13- to instantiate the Vector4R class:
11+ The `` Vector4R `` class available in Python wraps the C++ `` Vector4R `` class representing
12+ four-dimensional relativistic vectors.
13+ Three types of constructors allow to instantiate the `` Vector4R `` class:
1414
15- - Default empty constructor
16- - Copy constructor
17- - Constructor with 4 real (``float ``) numbers
15+ - Default empty constructor.
16+ - Copy constructor.
17+ - Constructor from 4 real (``float ``) numbers.
1818
1919.. code-block :: python
2020
@@ -28,19 +28,18 @@ to instantiate the Vector4R class:
2828 print (vec2) # (0.8385,0.1242,0.9821,1.2424)
2929 print (vec3) # (0.8385,0.1242,0.9821,1.2424)
3030
31- The Vector4R class also provides a pretty convenient method to create an
32- object from python list.
31+ The ``Vector4R `` class also provides a pretty convenient method to create an instance from a python list.
3332
3433.. code-block :: python
3534
3635 list_ = [0.9241 , 0.13223 , 0.13121 , 1.1141 ]
3736 vec4 = hp.Vector4R(list_)
3837
39- This will construct a new Vector4R object with the values passed within
38+ This will construct a new `` Vector4R `` object with the values passed within
4039a list. The list should contain exactly 4 elements otherwise a ``TypeError ``
4140will be raised.
4241The ``set `` methods can be used to set all 4 values or a particular value
43- in a Vector4R object, while the ``get `` method can be used with Vector4R
42+ in a `` Vector4R `` object, while the ``get `` method can be used with `` Vector4R ``
4443to get the value of a particular index. The ``__getitem__ `` and
4544``__setitem `` methods can also be used to get or set the value which comes
4645very handy and maintain more pythonic way to access and set the values.
@@ -61,9 +60,9 @@ very handy and maintain more pythonic way to access and set the values.
6160 vec5[1 ] = 0.5678
6261 print (vec5) # (0.1234,0.5678,0.9101,0.1121)
6362
64- The Vector4R object can be multiplied or divided by a real value while it
65- can be added or subtracted with another Vector4R object. One Vector4R
66- object can be multiplied by another Vector4R object.
63+ The `` Vector4R `` object can be multiplied or divided by a real value while it
64+ can be added or subtracted with another `` Vector4R `` object. One Vector4R
65+ object can be multiplied by another `` Vector4R `` object.
6766
6867.. code-block :: python
6968
@@ -80,17 +79,17 @@ object can be multiplied by another Vector4R object.
8079 vec6 -= vec7
8180 print (vec6) # (1.50608,1.69418,0.01925,2.1989)
8281
83- Two Vector4R objects can be easily added, subtracted or multiplied so :
82+ Two `` Vector4R `` objects can easily be added, subtracted or multiplied:
8483
8584 - ``v = v1 + v2 `` # Returns a Vector4R object
8685 - ``v = v1 - v2 `` # Returns a Vector4R object
8786 - ``v = v1 * v2 `` # Returns a real number
8887
89- All above three are valid for any Vector4R object. There are various
90- other methods available in Vector4R. The list of Vector4R
88+ All above three are valid for any `` Vector4R `` object. There are various
89+ other methods available in `` Vector4R `` . The list of `` Vector4R ``
9190methods can be found on [#f1 ]_.
9291
93- The Vector4R provides an ``assign `` method to assign or copy the Vector4R
92+ The `` Vector4R `` provides an ``assign `` method to assign or copy the Vector4R
9493object. This is a very useful method to avoid the nasty bugs for example:
9594
9695.. code-block :: python
@@ -111,13 +110,13 @@ object. This is a very useful method to avoid the nasty bugs for example:
111110 Vector3R
112111========
113112
114- The Vector3R class is the wrapper of C++ Vector3R class. This class basically
115- deals with the vector of 3 particles. We have three types of constructors
116- to instantiate the Vector3R class:
113+ The `` Vector43 `` class available in Python wraps the C++ `` Vector3R `` class representing
114+ three-dimensional Euclidian vectors.
115+ Three types of constructors allow to instantiate the `` Vector3R `` class:
117116
118- - Default empty constructor
119- - Copy constructor
120- - Constructor with 3 real (``float ``) numbers
117+ - Default empty constructor.
118+ - Copy constructor.
119+ - Constructor from 3 real (``float ``) numbers.
121120
122121.. code-block :: python
123122
@@ -131,19 +130,19 @@ to instantiate the Vector3R class:
131130 print (vec2) # (0.8385,0.1242,0.9821)
132131 print (vec3) # (0.8385,0.1242,0.9821)
133132
134- The Vector3R class also provides a pretty convenient method to create an
133+ The `` Vector3R `` class also provides a pretty convenient method to create an
135134object from python list.
136135
137136.. code-block :: python
138137
139138 list_ = [0.9241 , 0.13223 , 0.13121 ]
140139 vec4 = hp.Vector3R(list_)
141140
142- This will construct a new Vector3R object with the values passed within
141+ This will construct a new `` Vector3R `` object with the values passed within
143142a list. The list should contain exactly 3 elements otherwise a ``TypeError ``
144143will be raised.
145144The ``set `` methods can be used to set all 3 values or a particular value
146- in a Vector3R object, while the ``get `` method can be used with Vector3R
145+ in a `` Vector3R `` object, while the ``get `` method can be used with `` Vector3R ``
147146to get the value of a particular index. The ``__getitem__ `` and
148147``__setitem `` methods can also be used to get or set the value which comes
149148very handy and maintain more pythonic way to access and set the values.
@@ -164,9 +163,9 @@ very handy and maintain more pythonic way to access and set the values.
164163 vec5[1 ] = 0.5678
165164 print (vec5) # (0.1234,0.5678,0.9101)
166165
167- The Vector3R object can be multiplied or divided by a real value while it
168- can be added or subtracted with another Vector3R object. One Vector3R
169- object can be multiplied by another Vector3R object.
166+ The `` Vector3R `` object can be multiplied or divided by a real value while it
167+ can be added or subtracted with another `` Vector3R `` object. One `` Vector3R ``
168+ object can be multiplied by another `` Vector3R `` object.
170169
171170.. code-block :: python
172171
@@ -183,17 +182,17 @@ object can be multiplied by another Vector3R object.
183182 vec6 -= vec7
184183 print (vec6) # (1.50608,1.69418,0.01925)
185184
186- Two Vector3R objects can be easily added, subtracted or multiplied so :
185+ Two `` Vector3R `` objects can easily be added, subtracted or multiplied:
187186
188187 - ``v = v1 + v2 `` # Returns a Vector3R object
189188 - ``v = v1 - v2 `` # Returns a Vector3R object
190189 - ``v = v1 * v2 `` # Returns a real number
191190
192- All above three are valid for any Vector3R object. There are various
193- other methods available in Vector3R. The list of Vector3R
191+ All above three are valid for any `` Vector3R `` object. There are various
192+ other methods available in `` Vector3R `` . The list of `` Vector3R ``
194193methods can be found on [#f2 ]_.
195194
196- The Vector3R provides an ``assign `` method to assign or copy the Vector3R
195+ The `` Vector3R `` provides an ``assign `` method to assign or copy the Vector3R
197196object. This is a very useful method to avoid the nasty bugs for example:
198197
199198.. code-block :: python
0 commit comments