⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aff_transformationh2.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 3 页
字号:
transform( const typename Aff_transformationH2<R>::Direction_2& d) const{ return this->Ptr()->transform(d); }template < class R >typename Aff_transformationH2<R>::Line_2Aff_transformationH2<R>::transform( const typename Aff_transformationH2<R>::Line_2& l) const{ return Line_2( transform( l.point(0)), transform( l.point(1)) ); }template < class R >Aff_transformationH2<R>Aff_transformationH2<R>::inverse() const{ return this->Ptr()->inverse(); }template < class R >boolAff_transformationH2<R>::is_even() const{ return this->Ptr()->is_even(); }template < class R >boolAff_transformationH2<R>::is_odd() const{ return ! is_even(); }template < class R >inlinetypename Aff_transformationH2<R>::FTAff_transformationH2<R>::cartesian(int i, int j) const{ return this->Ptr()->cartesian(i,j); }template < class R >inlinetypename Aff_transformationH2<R>::RTAff_transformationH2<R>::homogeneous(int i, int j) const{ return this->Ptr()->homogeneous(i,j); }template < class R >Aff_transformation_repH2<R>Aff_transformationH2<R>::general_form() const{ return this->Ptr()->general_form(); }template <class R>Aff_transformationH2<R>//operator*(const Aff_transformationH2<R>& left_argument,//          const Aff_transformationH2<R>& right_argument )Aff_transformationH2<R>::operator*(const Aff_transformationH2<R>& right_argument) const{  return _general_transformation_composition(                  this->Ptr()->general_form(),                  right_argument.Ptr()->general_form() );}template <class R>Aff_transformationH2<R>_general_transformation_composition( Aff_transformation_repH2<R> l,                                     Aff_transformation_repH2<R> r ){return Aff_transformationH2<R>(       l.a*r.a + l.b*r.d,   l.a*r.b + l.b*r.e,   l.a*r.c + l.b*r.f + l.c*r.g,       l.d*r.a + l.e*r.d,   l.d*r.b + l.e*r.e,   l.d*r.c + l.e*r.f + l.f*r.g,                                                 l.g*r.g                     );}template < class R >typename Aff_transformation_repH2<R>::RTAff_transformation_repH2<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return a;              case 1: return b;              case 2: return c;            }    case 1: switch (j)            {              case 0: return d;              case 1: return e;              case 2: return f;            }    case 2: switch (j)            {              case 0: return RT(0);              case 1: return RT(0);              case 2: return g;            }  }  return RT(0);}template < class R >typename Aff_transformation_repH2<R>::FTAff_transformation_repH2<R>::cartesian(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  if ( (i == 2) && (j == 2) )  return FT(1);  return FT(homogeneous(i,j)) / FT(g);}template < class R >typename Translation_repH2<R>::RTTranslation_repH2<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return _tv.hw();              case 1: return RT(0);              case 2: return _tv.hx();            }    case 1: switch (j)            {              case 0: return RT(0);              case 1: return _tv.hw();              case 2: return _tv.hy();            }    case 2: switch (j)            {              case 0: return RT(0);              case 1: return RT(0);              case 2: return _tv.hw();            }  }  return RT(0);}template < class R >typename Translation_repH2<R>::FTTranslation_repH2<R>::cartesian(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return FT(1);              case 1: return FT(0);              case 2: return _tv.x();            }    case 1: switch (j)            {              case 0: return FT(0);              case 1: return FT(1);              case 2: return _tv.y();            }    case 2: switch (j)            {              case 0: return FT(0);              case 1: return FT(0);              case 2: return FT(1);            }  }  return FT(0);}template < class R >typename Rotation_repH2<R>::RTRotation_repH2<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return _cos;              case 1: return - _sin;              case 2: return RT(0);            }    case 1: switch (j)            {              case 0: return _sin;              case 1: return _cos;              case 2: return RT(0);            }    case 2: switch (j)            {              case 0: return RT(0);              case 1: return RT(0);              case 2: return _den;            }  }  return RT(0);}template < class R >typename Rotation_repH2<R>::FTRotation_repH2<R>::cartesian(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return FT(_cos) / FT(_den);              case 1: return - FT(_sin) / FT(_den);              case 2: return RT(0);            }    case 1: switch (j)            {              case 0: return FT(_sin) / FT(_den);              case 1: return FT(_cos) / FT(_den);              case 2: return FT(0);            }    case 2: switch (j)            {              case 0: return FT(0);              case 1: return FT(0);              case 2: return FT(1);            }  }  return FT(0);}template < class R >typename Scaling_repH2<R>::RTScaling_repH2<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return _sf_num;              case 1: return RT(0);              case 2: return RT(0);            }    case 1: switch (j)            {              case 0: return RT(0);              case 1: return _sf_num;              case 2: return RT(0);            }    case 2: switch (j)            {              case 0: return RT(0);              case 1: return RT(0);              case 2: return _sf_den;            }  }  return RT(0);}template <class R>typename Scaling_repH2<R>::FTScaling_repH2<R>::cartesian(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  switch (i)  {    case 0: switch (j)            {              case 0: return FT(_sf_num) / FT(_sf_den);              case 1: return FT(0);              case 2: return FT(0);            }    case 1: switch (j)            {              case 0: return FT(0);              case 1: return FT(_sf_num) / FT(_sf_den);              case 2: return FT(0);            }    case 2: switch (j)            {              case 0: return FT(0);              case 1: return FT(0);              case 2: return FT(1);            }  }  return FT(0);}template < class R >typename Reflection_repH2<R>::RTReflection_repH2<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  RT mRT2 = -RT(2);  switch (i)  {    case 0: switch (j)            {              case 0: return l.b()*l.b() - l.a()*l.a();              case 1: return l.a()*l.b()*mRT2;              case 2: return l.a()*l.c()*mRT2;            }    case 1: switch (j)            {              case 0: return l.a()*l.b()*mRT2;              case 1: return l.a()*l.a() - l.b()*l.b();              case 2: return l.b()*l.c()*mRT2;            }    case 2: switch (j)            {              case 0: return RT(0);              case 1: return RT(0);              case 2: return l.a()*l.a() + l.b()*l.b();            }  }  return RT(0);}template <class R>typename Reflection_repH2<R>::FTReflection_repH2<R>::cartesian(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) );  FT de = FT( l.a()*l.a() + l.b()*l.b() );  switch (i)  {    case 0: switch (j)            {              case 0: return FT( l.b()-l.a() ) / FT( l.a()+l.b());              case 1: return FT( homogeneous(0,1)) / de;              case 2: return FT( homogeneous(0,2)) / de;            }    case 1: switch (j)            {              case 0: return FT( homogeneous(1,0)) / de;              case 1: return FT( l.a()-l.b() ) / FT( l.a()+l.b());              case 2: return FT( homogeneous(1,2)) / de;            }    case 2: switch (j)            {              case 0: return FT(0);              case 1: return FT(0);              case 2: return FT(1);            }  }  return FT(0);}CGAL_END_NAMESPACE#endif // CGAL_AFF_TRANSFORMATIONH2_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -