22 #ifndef _vctAngleRotation2_h
23 #define _vctAngleRotation2_h
61 cmnThrow(std::runtime_error(
"vctAngleRotation2: This rotation is not normalized"));
69 template <
class _inputType>
71 if (! input.IsNormalized()) {
72 cmnThrow(std::runtime_error(
"vctAngleRotation2: Input is not normalized"));
101 throw(std::runtime_error)
107 template <
class _containerType>
109 throw(std::runtime_error)
111 From(matrixRotation);
141 if (normalizeInput) {
149 template <
class _containerType>
153 if (normalizeInput) {
166 inline const AngleType &
Angle(
void)
const {
193 throw(std::runtime_error)
201 template <
class _containerType>
204 throw(std::runtime_error)
207 this->
AngleMember = atan2(matrixRotation.Element(0, 1), matrixRotation.Element(0, 0));
233 template <
class _containerType>
260 template <
class _containerType>
263 AngleMember = atan2(matrixRotation.Element(0, 1), matrixRotation.Element(0, 0));
340 std::stringstream outputStream;
342 return outputStream.str();
346 inline void ToStream(std::ostream & outputStream)
const {
347 outputStream <<
"Angle: "
354 bool headerOnly =
false,
const std::string & headerPrefix =
"")
const {
356 outputStream << headerPrefix <<
"angle";
358 outputStream << this->
Angle();
385 #endif // _vctAngleRotation2_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
cmnTypeTraits< AngleType > TypeTraits
Definition: vctAngleRotation2.h:52
Define a rotation based on an angle for a space of dimension 2.
Definition: vctAngleRotation2.h:46
AngleType & Angle(void)
Definition: vctAngleRotation2.h:170
VCT_CONTAINER_TRAITS_TYPEDEFS(double)
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
ThisType Normalized(void) const
Definition: vctMatrixRotation2Base.h:619
vctAngleRotation2(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition: vctAngleRotation2.h:108
Declaration of cmnSerializer and functions cmnSerializeRaw.
static Type Tolerance(void)
Definition: cmnTypeTraits.h:170
ThisType & FromNormalized(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition: vctAngleRotation2.h:235
std::string ToString(void) const
Definition: vctAngleRotation2.h:339
ThisType & InverseOf(const ThisType &otherRotation)
Definition: vctAngleRotation2.h:281
vctAngleRotation2(const vctMatrixRotation2Base< _containerType > &matrixRotation, bool normalizeInput)
Definition: vctAngleRotation2.h:150
Declaration of various constants.
void ThrowUnlessIsNormalized(void) const
Definition: vctAngleRotation2.h:59
ThisType Inverse(void) const
Definition: vctAngleRotation2.h:289
vctAngleRotation2(const AngleType angle)
Definition: vctAngleRotation2.h:100
vctAngleRotation2()
Definition: vctAngleRotation2.h:80
void SerializeRaw(std::ostream &outputStream) const
Definition: vctAngleRotation2.h:363
ThisType & NormalizedOf(const ThisType &otherRotation)
Definition: vctAngleRotation2.h:311
Definition: vctAngleRotation2.h:50
AngleType AngleMember
Definition: vctAngleRotation2.h:55
Declaration of vctFixedSizeVector.
ThisType & InverseSelf(void)
Definition: vctAngleRotation2.h:274
ThisType & FromRaw(const AngleType angle)
Definition: vctAngleRotation2.h:253
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data)
Definition: cmnDeSerializer.h:82
Define a rotation matrix for a space of dimension 2.
Definition: vctForwardDeclarations.h:227
ThisType & From(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition: vctAngleRotation2.h:203
const AngleType & Angle(void) const
Definition: vctAngleRotation2.h:166
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data)
Definition: cmnSerializer.h:78
vctAngleRotation2 ThisType
Definition: vctAngleRotation2.h:51
vctAngleRotation2(const AngleType angle, bool normalizeInput)
Definition: vctAngleRotation2.h:138
#define cmnThrow(a)
Definition: MinimalCmn.h:4
ThisType Normalized(void) const
Definition: vctAngleRotation2.h:319
ThisType & FromRaw(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition: vctAngleRotation2.h:262
ThisType & FromNormalized(const AngleType angle)
Definition: vctAngleRotation2.h:225
ThisType & NormalizedSelf(void)
Definition: vctAngleRotation2.h:298
static CISST_EXPORT const ThisType & Identity()
std::ostream & operator<<(std::ostream &output, const vctAngleRotation2 &angleRotation)
Definition: vctAngleRotation2.h:378
void ToStreamRaw(std::ostream &outputStream, const char CMN_UNUSED(delimiter)= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition: vctAngleRotation2.h:353
void ToStream(std::ostream &outputStream) const
Definition: vctAngleRotation2.h:346
void DeSerializeRaw(std::istream &inputStream)
Definition: vctAngleRotation2.h:369
Macros to export the symbols of cisstVector (in a Dll).
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
void ThrowUnlessIsNormalized(const _inputType &input) const
Definition: vctAngleRotation2.h:70
const double cmnPI
Definition: cmnConstants.h:38
ThisType & From(const AngleType angle)
Definition: vctAngleRotation2.h:192
bool IsNormalized(AngleType CMN_UNUSED(tolerance)=TypeTraits::Tolerance()) const
Definition: vctAngleRotation2.h:334