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

References MatR2vec().

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-2004)" << std::endl
59  << std::endl;
60  exit(EXIT_SUCCESS);
61  }
62  }
63 
64  unsigned short int i1, i2;
65  static doublereal v1[3], v2[3];
66  while (true) {
67  std::cin >> i1;
68  if (std::cin) {
69  std::cin >> v1[0] >> v1[1] >> v1[2]
70  >> i2
71  >> v2[0] >> v2[1] >> v2[2];
72  std::cout << MatR2vec(i1, Vec3(v1), i2, Vec3(v2)) << std::endl;
73  } else {
74  break;
75  }
76  }
77 
78  return EXIT_SUCCESS;
79 }
Mat3x3 MatR2vec(unsigned short int ia, const Vec3 &va, unsigned short int ib, const Vec3 &vb)
Definition: matvec3.cc:779
Definition: matvec3.h:98
double doublereal
Definition: colamd.c:52

Here is the call graph for this function: