MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
eu2rot.cc File Reference
#include "mbconfig.h"
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "matvec3.h"
Include dependency graph for eu2rot.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 40 of file eu2rot.cc.

References EulerAngles2MatR(), and M_PI.

41 {
42  if (argn > 1) {
43  if (!strcasecmp(argv[1], "-?")
44  || !strcasecmp(argv[1], "-h")
45  || !strcasecmp(argv[1], "--help")) {
46  std::cerr << std::endl
47  << "usage: " << argv[0] << std::endl
48  << std::endl
49  << " reads the Euler angles (in degs)"
50  " from stdin;" << std::endl
51  << " writes the rotation matrix"
52  " on standard output" << std::endl
53  << " (m11, m12, m13,"
54  " m21, m22, m23,"
55  " m31, m32, m33)" << std::endl
56  << std::endl
57  << "part of MBDyn package (Copyright (C)"
58  " Pierangelo Masarati, 1996-2006)" << std::endl
59  << std::endl;
60  exit(EXIT_SUCCESS);
61  }
62  }
63 
64  std::cout.precision(16);
65 
66  static doublereal d[3];
67  while (true) {
68  std::cin >> d[0];
69  if (std::cin) {
70  std::cin >> d[1] >> d[2];
71  std::cout << EulerAngles2MatR(Vec3(d)/(180./M_PI)) << std::endl;
72  } else {
73  break;
74  }
75  }
76 
77  return EXIT_SUCCESS;
78 }
#define M_PI
Definition: gradienttest.cc:67
Definition: matvec3.h:98
Mat3x3 EulerAngles2MatR(const Vec3 &v)
Definition: matvec3.cc:1008
double doublereal
Definition: colamd.c:52

Here is the call graph for this function: