Bayeux  3.4.1
Core Foundation library for SuperNEMO
foot_point_on_quadric_finder.h
Go to the documentation of this file.
1 //
4 // Copyright (c) 2015 by François Mauger <mauger@lpccaen.in2p3.fr>
5 //
6 // This file is part of geomtools.
7 //
8 // geomtools is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // geomtools is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with geomtools. If not, see <http://www.gnu.org/licenses/>.
20 
21 #ifndef GEOMTOOLS_FOOT_POINT_ON_QUADRIC_FINDER_H
22 #define GEOMTOOLS_FOOT_POINT_ON_QUADRIC_FINDER_H
23 
24 // This project:
25 #include <geomtools/quadric.h>
26 
27 namespace geomtools {
28 
31  {
32  public:
33 
35  static double default_alpha_max();
36 
38  static unsigned int default_max_iter();
39 
41  void set_epsilon(double);
42 
44  void set_alpha_max(double);
45 
48  double epsilon_,
49  double alpha_max_ = -1.0,
50  unsigned int max_iter_ = 20,
51  const std::string & dbg_filename_ = "");
52 
54  int find(const geomtools::vector_3d & start_,
55  geomtools::vector_3d & foot_point_);
56 
57  protected:
58 
59  void _init();
60 
61  private:
62 
63  const quadric * _quadric_;
64  double _epsilon_;
65  double _alpha_max_;
66  unsigned int _max_iter_;
67  bool _debug_;
68  std::string _debug_filename_;
69 
70  };
71 
72 } // end of namespace geomtools
73 
74 #endif // GEOMTOOLS_POINT_ON_QUADRIC_FINDER_H
75 
76 /*
77 ** Local Variables: --
78 ** mode: c++ --
79 ** c-file-style: "gnu" --
80 ** tab-width: 2 --
81 ** End: --
82 */
foot_point_on_quadric_finder(const quadric &q_, double epsilon_, double alpha_max_=-1.0, unsigned int max_iter_=20, const std::string &dbg_filename_="")
Constructor.
void set_alpha_max(double)
Set the maximum value for alpha (dimensionless, default: 20)
int find(const geomtools::vector_3d &start_, geomtools::vector_3d &foot_point_)
Main foot point finder algorithm.
Marching method to find the foot point of a point on the surface of a quadric.
Definition: foot_point_on_quadric_finder.h:30
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
static double default_alpha_max()
Return default alpha max.
static unsigned int default_max_iter()
Return default max number of iterations.
Quadric surface.
A general quadric a 3D space.
Definition: quadric.h:31
void set_epsilon(double)
Set the absolute tolerance (length unit)
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39