xc
GeneralEquationOfPlane.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 //GeneralEquationOfPlane.h
22 
23 #ifndef GENERALEQUATIONOFPLANE_H
24 #define GENERALEQUATIONOFPLANE_H
25 
26 #include <vector>
27 #include "../cgal_types.h"
28 
29 class Pos3d;
30 class Pos2d;
31 
33 //
36 class GeneralEquationOfPlane: private std::vector<GEOM_FT>
37  {
38  std::vector<GEOM_RT> v;
39  public:
40 /* GeneralEquationOfPlane(const GEOM_RT &a,const GEOM_RT &b,const GEOM_RT &c,const GEOM_RT &d); */
41  GeneralEquationOfPlane(const GEOM_FT &fa,const GEOM_FT &fb,const GEOM_FT &fc,const GEOM_FT &fd);
42  inline const GEOM_RT &a(void) const
43  { return v[1]; }
44  inline const GEOM_RT &b(void) const
45  { return v[2]; }
46  inline const GEOM_RT &c(void) const
47  { return v[3]; }
48  inline const GEOM_RT &d(void) const
49  { return v[0]; }
50  GEOM_FT Eval(const Pos3d &p) const;
51 
52  GEOM_FT x(const GEOM_FT &y,const GEOM_FT &z) const;
53  GEOM_FT x(const Pos2d &p) const;
54  GEOM_FT y(const GEOM_FT &x,const GEOM_FT &z) const;
55  GEOM_FT y(const Pos2d &p) const;
56  GEOM_FT z(const GEOM_FT &x,const GEOM_FT &y) const;
57  GEOM_FT z(const Pos2d &p) const;
58  };
59 
60 #endif
GEOM_FT y(const GEOM_FT &x, const GEOM_FT &z) const
Return the y coordinate del point of the plane whose x and z coordinates are given.
Definition: GeneralEquationOfPlane.cc:56
Posición en dos dimensiones.
Definition: Pos2d.h:41
GEOM_FT z(const GEOM_FT &x, const GEOM_FT &y) const
Return the z coordinate del point of the plane whose x and y coordinates are given.
Definition: GeneralEquationOfPlane.cc:66
Equation for a plane in general form: ax + by + cz + d = 0 where v[0]= d, v[1]= a, v[2]= b, v[3]= c.
Definition: GeneralEquationOfPlane.h:36
GEOM_FT x(const GEOM_FT &y, const GEOM_FT &z) const
Return the x coordinate of the point of the plane whose y and z coordinates are given.
Definition: GeneralEquationOfPlane.cc:46
Posición en tres dimensiones.
Definition: Pos3d.h:44