Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
point_vector_definitions_2.C
Go to the documentation of this file.
1 
2 // ======================================================================
3 //
4 // Copyright (c) 1999 The CGAL Consortium
5 
6 // This software and related documentation is part of the Computational
7 // Geometry Algorithms Library (CGAL).
8 // This software and documentation is provided "as-is" and without warranty
9 // of any kind. In no event shall the CGAL Consortium be liable for any
10 // damage of any kind.
11 //
12 // Every use of CGAL requires a license.
13 //
14 // Academic research and teaching license
15 // - For academic research and teaching purposes, permission to use and copy
16 // the software and its documentation is hereby granted free of charge,
17 // provided that it is not a component of a commercial product, and this
18 // notice appears in all copies of the software and related documentation.
19 //
20 // Commercial licenses
21 // - A commercial license is available through Algorithmic Solutions, who also
22 // markets LEDA (http://www.algorithmic-solutions.de).
23 // - Commercial users may apply for an evaluation license by writing to
24 // Algorithmic Solutions (contact@algorithmic-solutions.com).
25 //
26 // The CGAL Consortium consists of Utrecht University (The Netherlands),
27 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
28 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
29 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
30 // and Tel-Aviv University (Israel).
31 //
32 // ----------------------------------------------------------------------
33 //
34 // release : CGAL-2.2
35 // release_date : 2000, September 30
36 //
37 // source : PV_decl.fw
38 // file : include/CGAL/point_vector_definitions_2.C
39 // package : _2 (3.6)
40 // revision : 3.6
41 // revision_date : 30 Jul 2000
42 // author(s) : Stefan Schirra
43 //
44 //
45 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 
52 #ifndef CGAL_POINT_VECTOR_DEFINITIONS_2_C
53 #define CGAL_POINT_VECTOR_DEFINITIONS_2_C
54 
56 
57 template < class R >
58 inline
61 { return Vector_2<R>(p); }
62 
63 template < class R >
64 inline
67 { return Point_2<R>(v); }
68 
69 template < class R >
70 inline
72 operator+(const Point_2<R>& p, const Vector_2<R>& v)
73 {
74  typedef typename R::Point_2_base RPoint_2;
75  typedef typename R::Vector_2_base RVector_2;
76  return Point_2<R>((const RPoint_2& )p + (const RVector_2& )v) ;
77 }
78 
79 template < class R >
80 inline
82 operator-(const Point_2<R>& p, const Vector_2<R>& v)
83 {
84  typedef typename R::Point_2_base RPoint_2;
85  typedef typename R::Vector_2_base RVector_2;
86  return Point_2<R>((const RPoint_2& )p - (const RVector_2& )v) ;
87 }
88 
89 template < class R >
90 inline
92 operator+(const Origin& , const Vector_2<R>& v)
93 { return vector_to_point_conversion(v) ; }
94 
95 template < class R >
96 inline
98 operator-(const Origin& , const Vector_2<R>& v)
99 { return vector_to_point_conversion(-v) ; }
100 
101 template < class R >
102 inline
104 operator-(const Point_2<R>& p, const Point_2<R>& q)
105 {
106  typedef typename R::Point_2_base RPoint_2;
107  return Vector_2<R>((const RPoint_2& )p - (const RPoint_2& )q) ;
108 }
109 
110 template < class R >
111 inline
113 operator-(const Point_2<R>& p, const Origin& )
114 { return point_to_vector_conversion(p) ; }
115 
116 template < class R >
117 inline
119 operator-(const Origin& , const Point_2<R>& p)
120 {
121  typedef typename R::Point_2_base RPoint_2;
122  return Vector_2<R>(ORIGIN - (const RPoint_2& )p) ;
123 }
124 
126 
127 
128 #endif // CGAL_POINT_VECTOR_DEFINITIONS_2_C
CGAL_BEGIN_NAMESPACE Vector_2< R > point_to_vector_conversion(const Point_2< R > &p)
Iterator_from_circulator< C, Ref, Ptr > operator+(Dist n, const Iterator_from_circulator< C, Ref, Ptr > &circ)
Definition: circulator.h:689
Point_2< R > vector_to_point_conversion(const Vector_2< R > &v)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
Origin ORIGIN
Definition: Origin.C:61
NT q
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
Point_2< R > operator-(const Origin &o, const Vector_2< R > &v)