MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
rot2eup.cc File Reference
#include "mbconfig.h"
#include <cstring>
#include <iostream>
#include "matvec3.h"
Include dependency graph for rot2eup.cc:

Go to the source code of this file.

Functions

int main (int argn, const char *const argv[])
 

Function Documentation

int main ( int  argn,
const char *const  argv[] 
)

Definition at line 39 of file rot2eup.cc.

References MatR2EulerParams().

40 {
41  if (argn > 1) {
42  if (!strcasecmp(argv[1], "-?")
43  || !strcasecmp(argv[1], "-h")
44  || !strcasecmp(argv[1], "--help")) {
45  std::cerr << std::endl << "usage: " << argv[0] << std::endl << std::endl
46  << " reads a rotation matrix (row-oriented) from stdin;" << std::endl
47  << " writes the Euler parameters on standard output" << std::endl << std::endl
48  << "part of MBDyn package (Copyright (C) Pierangelo Masarati, 1996)" << std::endl << std::endl;
49  exit(EXIT_SUCCESS);
50  }
51  }
52 
53  static doublereal d[9];
54  while (true) {
55  std::cin >> d[0];
56  if (std::cin) {
57  Vec3 e;
58  doublereal e0;
59  std::cin >> d[3] >> d[6] >> d[1] >> d[4] >> d[7] >> d[2] >> d[5] >> d[8];
60  MatR2EulerParams(Mat3x3(d, 3), e0, e);
61  std::cout << e0 << " " << e << std::endl;
62  } else {
63  break;
64  }
65  }
66 
67  return (EXIT_SUCCESS);
68 }
Definition: matvec3.h:98
double doublereal
Definition: colamd.c:52
void MatR2EulerParams(const Mat3x3 &R, doublereal &e0, Vec3 &e)
Definition: matvec3.cc:954

Here is the call graph for this function: