BWAPI
|
00001 // Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France). 00002 // All rights reserved. 00003 // 00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under 00005 // the terms of the Q Public License version 1.0. 00006 // See the file LICENSE.QPL distributed with CGAL. 00007 // 00008 // Licensees holding a valid commercial license may use this file in 00009 // accordance with the commercial license agreement provided with the software. 00010 // 00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 // 00014 // Partially supported by the IST Programme of the EU as a Shared-cost 00015 // RTD (FET Open) Project under Contract No IST-2000-26473 00016 // (ECG - Effective Computational Geometry for Curves and Surfaces) 00017 // and a STREP (FET Open) Project under Contract No IST-006413 00018 // (ACS -- Algorithms for Complex Shapes) 00019 // 00020 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Algebraic_kernel_for_spheres/include/CGAL/Polynomials_for_line_3.h $ 00021 // $Id: Polynomials_for_line_3.h 46224 2008-10-13 11:22:46Z pmachado $ 00022 // 00023 // Author(s) : Monique Teillaud <Monique.Teillaud@sophia.inria.fr> 00024 // Sylvain Pion 00025 // Pedro Machado 00026 00027 #ifndef CGAL_ALGEBRAIC_KERNEL_POLYNOMIALS_FOR_LINE_3_H 00028 #define CGAL_ALGEBRAIC_KERNEL_POLYNOMIALS_FOR_LINE_3_H 00029 00030 #include <CGAL/enum.h> 00031 00032 CGAL_BEGIN_NAMESPACE 00033 00034 template < typename FT_ > 00035 class Polynomials_for_line_3 00036 { 00037 FT_ rep[6]; // stores a1, b1, a2, b2, c3, d3 00038 // x = a1 t + b1 00039 // y = a2 t + b2 00040 // z = a3 t + b3 00041 public: 00042 00043 typedef FT_ FT; 00044 00045 Polynomials_for_line_3(){} 00046 00047 Polynomials_for_line_3(const FT & a1, const FT & b1, 00048 const FT & a2, const FT & b2, 00049 const FT & a3, const FT & b3) 00050 { 00051 rep[0] = a1; 00052 rep[1] = b1; 00053 rep[2] = a2; 00054 rep[3] = b2; 00055 rep[4] = a3; 00056 rep[5] = b3; 00057 } 00058 00059 const FT & a1() const 00060 { return rep[0]; } 00061 00062 const FT & b1() const 00063 { return rep[1]; } 00064 00065 const FT & a2() const 00066 { return rep[2]; } 00067 00068 const FT & b2() const 00069 { return rep[3]; } 00070 00071 const FT & a3() const 00072 { return rep[4]; } 00073 00074 const FT & b3() const 00075 { return rep[5]; } 00076 00077 bool degenerated() const { 00078 return is_zero(a1()) && 00079 is_zero(a2()) && 00080 is_zero(a3()); 00081 } 00082 00083 }; 00084 00085 template < typename FT > 00086 inline 00087 bool 00088 operator == ( const Polynomials_for_line_3<FT> & p1, 00089 const Polynomials_for_line_3<FT> & p2 ) 00090 { 00091 return( (p1.a1() == p2.a1()) && 00092 (p1.b1() == p2.b1()) && 00093 (p1.a2() == p2.a2()) && 00094 (p1.b2() == p2.b2()) && 00095 (p1.a3() == p2.a3()) && 00096 (p1.b3() == p2.b3())); 00097 } 00098 00099 CGAL_END_NAMESPACE 00100 00101 #endif //CGAL_ALGEBRAIC_KERNEL_POLYNOMIALS_FOR_LINE_3_H