xc
PrincipalAxes2D.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //PrincipalAxes2D.h
22 
23 #ifndef PRINCIPALAXESOFINERTIA2D_H
24 #define PRINCIPALAXESOFINERTIA2D_H
25 
26 #include "utility/geom/pos_vec/Pos2d.h"
27 #include "utility/geom/pos_vec/Vector2d.h"
28 
29 class Ref2d2d;
30 
32 //
35  {
36  Pos2d center_of_mass;
37  Vector2d axis1;
38  GEOM_FT i1;
39  GEOM_FT i2;
40  public:
41  PrincipalAxes2D(void);
42  PrincipalAxes2D(const Pos2d &, const double A[2][2]);
43  PrincipalAxes2D(const Pos2d &,const GEOM_FT &,const GEOM_FT &,const GEOM_FT &);
44  inline Pos2d getOrg(void) const
45  { return center_of_mass; }
46  Ref2d2d getAxis(void) const;
47  const GEOM_FT &I1() const;
48  const GEOM_FT &I2() const;
49  inline Vector2d getAxis1VDir(void) const
50  { return axis1; }
51  Vector2d getAxis2VDir(void) const;
52  };
53 
54 std::ostream &operator<<(std::ostream &os,const PrincipalAxes2D &axis);
55 
56 
57 #endif
58 
59 
60 
61 
Posición en dos dimensiones.
Definition: Pos2d.h:41
Principals axes of inertia in planar geometry.
Definition: PrincipalAxes2D.h:34
Vector en dos dimensiones.
Definition: Vector2d.h:41
Two-dimensional reference system defined in a two-dimensional space.
Definition: Ref2d2d.h:39
Vector2d getAxis2VDir(void) const
Return the direction vector of the minor principal axis of inertia.
Definition: PrincipalAxes2D.cc:73
PrincipalAxes2D(void)
Constructor.
Definition: PrincipalAxes2D.cc:29