|
MULTIBODY SIMULATION SOFTWARE - API documentation |
#include <CHvector.h>
Public Member Functions | |
| ChVector (const Real nx, const Real ny, const Real nz) | |
| ChVector (const ChVector< Real > &other) | |
| template<class RealB> | |
| ChVector (const ChVector< RealB > &other) | |
| ChVector< Real > & | operator= (const ChVector< Real > &other) |
| template<class RealB> | |
| ChVector< Real > & | operator= (const ChVector< RealB > &other) |
| ChVector< Real > | operator- () const |
| Real & | operator() (const int el) |
| const Real & | operator() (const int el) const |
| ChVector< Real > | operator+ (const ChVector< Real > &other) const |
| ChVector< Real > & | operator+= (const ChVector< Real > &other) |
| ChVector< Real > | operator- (const ChVector< Real > &other) const |
| ChVector< Real > & | operator-= (const ChVector< Real > &other) |
| ChVector< Real > | operator * (const ChVector< Real > &other) const |
| ChVector< Real > & | operator *= (const ChVector< Real > &other) |
| ChVector< Real > | operator * (const Real v) const |
| ChVector< Real > & | operator *= (const Real v) |
| ChVector< Real > | operator/ (const ChVector< Real > &other) const |
| ChVector< Real > & | operator/= (const ChVector< Real > &other) |
| ChVector< Real > | operator/ (const Real v) const |
| ChVector< Real > & | operator/= (const Real v) |
| ChVector< Real > | operator% (const ChVector< Real > &other) const |
| ChVector< Real > & | operator%= (const ChVector< Real > &other) const |
| double | operator^ (const ChVector< Real > &other) const |
| bool | operator<= (const ChVector< Real > &other) const |
| bool | operator>= (const ChVector< Real > &other) const |
| bool | operator< (const ChVector< Real > &other) const |
| bool | operator> (const ChVector< Real > &other) const |
| bool | operator== (const ChVector< Real > &other) const |
| bool | operator!= (const ChVector< Real > &other) const |
| void | Set (const Real nx, const Real ny, const Real nz) |
| void | Set (const ChVector< Real > &p) |
| void | Set (const Real p) |
| void | SetNull () |
| bool | Equals (const ChVector< Real > &other) const |
| bool | Equals (const ChVector< Real > &other, Real tol) const |
| void | Add (const ChVector< Real > A, const ChVector< Real > B) |
| void | Sub (const ChVector< Real > A, const ChVector< Real > B) |
| void | Cross (const ChVector< Real > A, const ChVector< Real > B) |
| double | Dot (const ChVector< Real > A, const ChVector< Real > B) |
| double | Dot (const ChVector< Real > B) |
| void | Mul (const ChVector< Real > A, const Real v) |
| void | Scale (const Real v) |
| double | Length () |
| double | Length2 () |
| double | LengthInf () |
| bool | Normalize () |
| void | SetLength (Real v) |
| void | StreamOUT (ChStreamOutAscii &mstream) |
| void | StreamOUT (ChStreamOutBinary &mstream) |
| void | StreamIN (ChStreamInBinary &mstream) |
Public Attributes | |
| Real | x |
| Real | y |
| Real | z |
The vector object comes either with the template "ChVector<type>" mode, either in the 'shortcut' flavour, that is "Vector", which assumes the type of x,y,z is double precision, so it is faster to type. For example, for a declaration, you can write "ChVector<double> foo;", as well as "Vector foo;" (less typing effort for the second..)
| chrono::ChVector< Real >::ChVector | ( | const ChVector< Real > & | other | ) |
Copy constructor.
| chrono::ChVector< Real >::ChVector | ( | const ChVector< RealB > & | other | ) |
Copy constructor between vectors float<->double etc.
| ChVector<Real>& chrono::ChVector< Real >::operator= | ( | const ChVector< Real > & | other | ) |
Assignment operator: copy from another vector.
| ChVector<Real> chrono::ChVector< Real >::operator- | ( | ) | const |
Operator for sign change.
| Real& chrono::ChVector< Real >::operator() | ( | const int | el | ) |
Operator for indexed access (0=x, 1=y, 2=z). Not so much performance..may be useful sometimes..
| ChVector<Real> chrono::ChVector< Real >::operator+ | ( | const ChVector< Real > & | other | ) | const |
Operator for vector sum.
| ChVector<Real> chrono::ChVector< Real >::operator- | ( | const ChVector< Real > & | other | ) | const |
Operator for vector difference.
| ChVector<Real> chrono::ChVector< Real >::operator * | ( | const ChVector< Real > & | other | ) | const |
Operator for element-wise multiplication (note that this is neither dot product nor cross product!)
| ChVector<Real> chrono::ChVector< Real >::operator * | ( | const Real | v | ) | const |
Operator for scaling the vector by a scalar value, as v*s.
| ChVector<Real> chrono::ChVector< Real >::operator/ | ( | const ChVector< Real > & | other | ) | const |
Operator for element-wise division (note that 3D vector algebra is a skew field, non-divisional algebra, so this division operation is just an element-by element division)
| ChVector<Real> chrono::ChVector< Real >::operator/ | ( | const Real | v | ) | const |
Operator for scaling the vector by inverse of a scalar value, as v/s.
| ChVector<Real> chrono::ChVector< Real >::operator% | ( | const ChVector< Real > & | other | ) | const |
Operator for cross product: AB means the vector cross-product AxB Note: pay attention to operator low precedence (see C++ precedence rules!)
| double chrono::ChVector< Real >::operator^ | ( | const ChVector< Real > & | other | ) | const |
Operator for dot product: A^B means the scalar dot-product A*B Note: pay attention to operator low precedence (see C++ precedence rules!)
| void chrono::ChVector< Real >::Set | ( | const Real | nx, | |
| const Real | ny, | |||
| const Real | nz | |||
| ) |
Sets the three values of the vector at once.
| void chrono::ChVector< Real >::Set | ( | const ChVector< Real > & | p | ) |
Sets the vector as a copy of another vector.
| void chrono::ChVector< Real >::Set | ( | const Real | p | ) |
Sets the vector with three components as a sample scalar.
| void chrono::ChVector< Real >::SetNull | ( | ) |
Sets the vector as a null vector.
| bool chrono::ChVector< Real >::Equals | ( | const ChVector< Real > & | other | ) | const |
Returns true if vector is identical to other vector.
| bool chrono::ChVector< Real >::Equals | ( | const ChVector< Real > & | other, | |
| Real | tol | |||
| ) | const |
Returns true if vector equals another vector, within a tolerance 'tol'.
| void chrono::ChVector< Real >::Add | ( | const ChVector< Real > | A, | |
| const ChVector< Real > | B | |||
| ) |
The vector becomes the sum of the two vectors A and B: this=A+B
| void chrono::ChVector< Real >::Sub | ( | const ChVector< Real > | A, | |
| const ChVector< Real > | B | |||
| ) |
The vector becomes the difference of the two vectors A and B: this=A-B
| void chrono::ChVector< Real >::Cross | ( | const ChVector< Real > | A, | |
| const ChVector< Real > | B | |||
| ) |
The vector becomes the cross product of the two vectors A and B: this=AxB
| double chrono::ChVector< Real >::Dot | ( | const ChVector< Real > | A, | |
| const ChVector< Real > | B | |||
| ) |
Gives the dot product of the two vectors A and B:.
| double chrono::ChVector< Real >::Dot | ( | const ChVector< Real > | B | ) |
Gives the dot product with another vector: result=this*B
| void chrono::ChVector< Real >::Mul | ( | const ChVector< Real > | A, | |
| const Real | v | |||
| ) |
The vector becomes the product of a vectors A and a scalar v: this=A*v
| void chrono::ChVector< Real >::Scale | ( | const Real | v | ) |
The vector is multiplied by a scalar factor 's' this*=v
| double chrono::ChVector< Real >::Length | ( | ) |
Computes the euclidean norm of the vector, that is its length or magnitude
| double chrono::ChVector< Real >::Length2 | ( | ) |
Computes the euclidean norm of the vector, squared (i.e. as Length(), but skipping the square root)
| double chrono::ChVector< Real >::LengthInf | ( | ) |
Computes the infinite norm of the vector, that is the maximum absolute value of one of its elements
| bool chrono::ChVector< Real >::Normalize | ( | ) |
Normalize this vector, so that its euclidean length is 1. Returns false if original vector had zero length (in such a case it will be defaulted as VECT_X) otherwise returns true for success.
| void chrono::ChVector< Real >::SetLength | ( | Real | v | ) |
Impose a new length to the vector, keeping the direction unchanged.
| void chrono::ChVector< Real >::StreamOUT | ( | ChStreamOutAscii & | mstream | ) |
Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"
| void chrono::ChVector< Real >::StreamOUT | ( | ChStreamOutBinary & | mstream | ) |
Method to allow serializing transient data into a persistent binary archive (ex: a file).
| void chrono::ChVector< Real >::StreamIN | ( | ChStreamInBinary & | mstream | ) |
Method to allow deserializing a persistent binary archive (ex: a file) into transient data.
CHRONO::ENGINE