Changes after Laurent's review

This commit is contained in:
Andreas Fabri
2016-11-03 14:53:15 +01:00
committed by Jane Tournois
parent e39f76b953
commit f488b9baf9
26 changed files with 484 additions and 548 deletions
@@ -71,6 +71,69 @@ squared_distance( const PointH2<R>& p, const PointH2<R>& q )
return FT( sq_dist_numerator ) / FT( sq_dist_denominator );
}
template < class RT, class We>
void
weighted_circumcenterH2( const RT &phx, const RT &phy, const RT &phw,
const We &pwt,
const RT &qhx, const RT &qhy, const RT &qhw,
const We &qwt,
const RT &rhx, const RT &rhy, const RT &rhw,
const We &rwt,
RT &vvx, RT &vvy, RT &vvw )
{
// RT qx_px = ( qhx*qhw*phw*phw - phx*phw*qhw*qhw );
// RT qy_py = ( qhy*qhw*phw*phw - phy*phw*qhw*qhw );
// RT rx_px = ( rhx*rhw*phw*phw - phx*phw*rhw*rhw );
// RT ry_py = ( rhy*rhw*phw*phw - phy*phw*rhw*rhw );
// //intersection of the two radical axis of (qp) and (rp)
// RT px2_py2_rx2_ry_2 =
// phx*phx*rhw*rhw + phy*phy*rhw*rhw - rhx*rhx*phw*phw -
// rhy*rhy*phw*phw - RT(pwt*pwt) + RT(rwt*rwt);
// RT px2_py2_qx2_qy_2 =
// phx*phx*qhw*qhw + phy*phy*qhw*qhw - qhx*qhx*phw*phw -
// qhy*qhy*phw*phw - RT(pwt*pwt) + RT(qwt*qwt);
// vvx = qy_py * px2_py2_rx2_ry_2 - ry_py * px2_py2_qx2_qy_2;
// vvy = rx_px * px2_py2_qx2_qy_2 - qx_px * px2_py2_rx2_ry_2;
// vvw = RT(2) * ( qx_px * ry_py - rx_px * qy_py );
RT a1, b1, c1;
RT a2, b2, c2;
radical_axisH2(phx,phy,phw,pwt,qhx,qhy,qhw,qwt,a1,b1,c1);
radical_axisH2(phx,phy,phw,pwt,rhx,rhy,rhw,rwt,a2,b2,c2);
vvx = b1*c2 - c1*b2;
vvy = c1*a2 - c2*a1;
vvw = a1*b2 - a2*b1;
}
template < class RT , class FT>
void
radical_axisH2(const RT &phx, const RT &phy, const RT &phw, const FT &pwt,
const RT &qhx, const RT &qhy, const RT &qhw, const FT &qwt,
RT &a, RT &b, RT &c )
{
Rational_traits<FT> rt;
RT npwt = rt.numerator(pwt);
RT dpwt = rt.denominator(pwt);
RT nqwt = rt.numerator(qwt);
RT dqwt = rt.denominator(qwt);
a = RT(2) * ( phx*phw*qhw*qhw - qhx*qhw*phw*phw );
b = RT(2) * ( phy*phw*qhw*qhw - qhy*qhw*phw*phw );
c = (- phx*phx*qhw*qhw - phy*phy*qhw*qhw
+ qhx*qhx*phw*phw + qhy*qhy*phw*phw) * dpwt * dqwt
+ npwt*dqwt*phw*phw*qhw*qhw - nqwt*dpwt*phw*phw*qhw*qhw;
}
} //namespace CGAL
#endif // CGAL_BASIC_CONSTRUCTIONSH2_H