Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
basic_constructionsS3.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 // release : CGAL-2.2
33 // release_date : 2000, September 30
34 //
35 // source : webS3/S3.lw
36 // file : include/CGAL/SimpleCartesian/basic_constructionsS3.h
37 // package : S3 (1.6)
38 // revision : 1.6
39 // revision_date : 28 Jun 2000
40 // author(s) : Stefan Schirra
41 // based on code by
42 // Andreas Fabri and
43 // Herve Brönnimann
44 //
45 // coordinator : MPI, Saarbrücken
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 #ifndef CGAL_BASIC_CONSTRUCTIONSS3_H
52 #define CGAL_BASIC_CONSTRUCTIONSS3_H
53 
54 #include <CGAL/SimpleCartesian/PointS3.h>
57 
59 
60 template < class FT >
63 midpoint( PointS3<FT> const& p, PointS3<FT> const& q )
64 {
65  FT x,y,z;
66  midpointC3(p.x(),p.y(),p.z(),q.x(),q.y(),q.z(),x,y,z);
67  return PointS3<FT>(x,y,z);
68 }
69 
70 template < class FT >
73  PointS3<FT> const& q,
74  PointS3<FT> const& r,
75  PointS3<FT> const& s)
76 {
77  FT x,y,z;
78  circumcenterC3(p.x(),p.y(),p.z(),
79  q.x(),q.y(),q.z(),
80  r.x(),r.y(),r.z(),
81  s.x(),s.y(),s.z(),
82  x,y,z);
83  return PointS3<FT>(x,y,z);
84 }
85 
86 template <class FT>
89 projection(const PointS3<FT>& p, const PlaneS3<FT>& h)
90 {
91  FT x,y,z;
92  projection_planeC3(h.a(),h.b(),h.c(),h.d(),
93  p.x(),p.y(),p.z(),
94  x,y,z);
95  return PointS3<FT>(x,y,z);
96 }
97 
98 
99 template < class FT >
100 inline
101 FT
103 {
104  return squared_distanceC3(p.x(),p.y(),p.z(),q.x(),q.y(),q.z());
105 }
106 
107 template < class FT >
108 inline
109 FT
111 {
112  return scaled_distance_to_planeC3(h.a(),h.b(),h.c(),h.d(),
113  p.x(),p.y(),p.z());
114 }
115 
116 template < class FT >
117 inline
118 FT
120  const PointS3<FT>& hq,
121  const PointS3<FT>& hr,
122  const PointS3<FT>& p)
123 {
124  return scaled_distance_to_planeC3(hp.x(),hp.y(),hp.z(),
125  hq.x(),hq.y(),hq.z(),
126  hr.x(),hr.y(),hr.z(),
127  p.x(),p.y(),p.z());
128 }
129 
130 template < class FT >
131 inline
134 { return PlaneS3<FT>( midpoint(p,q), q-p); }
135 
136 template < class FT >
137 inline
140  const PlaneS3<FT>& g,
141  const PlaneS3<FT>& h)
142 {
143  return PointS3<FT>( det3x3_by_formula(-f.d(), f.b(), f.c(),
144  -g.d(), g.b(), g.c(),
145  -h.d(), h.b(), h.c()),
146  det3x3_by_formula( f.a(),-f.d(), f.c(),
147  g.a(),-g.d(), g.c(),
148  h.a(),-h.d(), h.c()),
149  det3x3_by_formula( f.a(), f.b(),-f.d(),
150  g.a(), g.b(),-g.d(),
151  h.a(), h.b(),-h.d()),
152  det3x3_by_formula( f.a(), f.b(), f.c(),
153  g.a(), g.b(), g.c(),
154  h.a(), h.b(), h.c()));
155 }
156 
158 
159 #endif // CGAL_BASIC_CONSTRUCTIONSS3_H
const FT & d() const
Definition: PlaneS3.h:234
PlaneS3< FT > bisector(const PointS3< FT > &p, const PointS3< FT > &q)
CGAL_KERNEL_MEDIUM_INLINE void projection_planeC3(const FT &pa, const FT &pb, const FT &pc, const FT &pd, const FT &px, const FT &py, const FT &pz, FT &x, FT &y, FT &z)
void int int REAL REAL * y
Definition: read.cpp:74
double s
Definition: blastest.C:80
CGAL_KERNEL_MEDIUM_INLINE FT det3x3_by_formula(const FT &a00, const FT &a01, const FT &a02, const FT &a10, const FT &a11, const FT &a12, const FT &a20, const FT &a21, const FT &a22)
Definition: determinant.h:71
CGAL_KERNEL_INLINE FT scaled_distance_to_planeC3(const FT &pa, const FT &pb, const FT &pc, const FT &pd, const FT &px, const FT &py, const FT &pz)
PointS3< FT > gp_linear_intersection(const PlaneS3< FT > &f, const PlaneS3< FT > &g, const PlaneS3< FT > &h)
#define CGAL_KERNEL_MEDIUM_INLINE
Definition: kernel_basic.h:55
const FT & c() const
Definition: PlaneS3.h:229
FT squared_distance(const PointS3< FT > &p, const PointS3< FT > &q)
void int int int REAL REAL REAL * z
Definition: write.cpp:76
#define CGAL_KERNEL_LARGE_INLINE
Definition: kernel_basic.h:56
FT scaled_distance_to_plane(const PlaneS3< FT > &h, const PointS3< FT > &p)
CGAL_KERNEL_INLINE FT squared_distanceC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz)
CGAL_BEGIN_NAMESPACE CGAL_KERNEL_INLINE void midpointC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, FT &x, FT &y, FT &z)
const FT & b() const
Definition: PlaneS3.h:224
void int int REAL * x
Definition: read.cpp:74
const FT & a() const
Definition: PlaneS3.h:219
NT q
CGAL_KERNEL_LARGE_INLINE PointS3< FT > projection(const PointS3< FT > &p, const PlaneS3< FT > &h)
void circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz, const FT &sx, const FT &sy, const FT &sz, FT &x, FT &y, FT &z)
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
CGAL_BEGIN_NAMESPACE CGAL_KERNEL_MEDIUM_INLINE PointS3< FT > midpoint(PointS3< FT > const &p, PointS3< FT > const &q)
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
PointS3< FT > circumcenter(PointS3< FT > const &p, PointS3< FT > const &q, PointS3< FT > const &r, PointS3< FT > const &s)