cheshirekow  v0.1.0
inversion.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
26 #ifndef MPBLOCKS_BROWN79_INVERSION_H_
27 #define MPBLOCKS_BROWN79_INVERSION_H_
28 
29 namespace mpblocks {
30 namespace brown79 {
31 
33 
43 template <class Traits>
44 class Inversion {
45  public:
46  typedef typename Traits::Scalar Scalar;
47  typedef typename Traits::Point Point;
48 
49  private:
52 
53  public:
55  Inversion();
56 
58  Inversion(const Point& center, Scalar radius = 1.0);
59 
61  void init(const Point& center, Scalar radius = 1.0);
62 
64  Point invert(const Point& p);
65 
67  Point operator()(const Point& p);
68 
70  const Point& center() const;
71 
73  Scalar radius() const;
74 };
75 
76 } // namespace brown79
77 } // namespace mpblocks
78 
79 #endif // INVERSION_H_
Point invert(const Point &p)
invert a point
Definition: inversion.hpp:46
Scalar radius() const
return the radius of this inversion map
Definition: inversion.hpp:69
Scalar m_radius
the radius of inversion
Definition: inversion.h:51
Point m_center
the center of inversion
Definition: inversion.h:50
void init(const Point &center, Scalar radius=1.0)
alter the inversion map to have a new center and radius
Definition: inversion.hpp:40
Point operator()(const Point &p)
invert a point
Definition: inversion.hpp:58
Represents the inversion operator described in Brown.
Definition: inversion.h:44
const Point & center() const
return the center of this inversion map
Definition: inversion.hpp:64
Inversion()
create an uninitialized inversion
Definition: inversion.hpp:32