mirror of https://github.com/CGAL/cgal
Merge pull request #52 from sloriot/CGAL_ipelets-use_to_double-sloriot
using the free function to_double instead of the member function Tested in CGAL-4.7-Ic-11.
This commit is contained in:
commit
e0f94c42ac
|
|
@ -88,7 +88,7 @@ void distanceIpelet::protected_run(int fn)
|
|||
if (pt_list.end()!=it) {
|
||||
print_error_message(("More than two marks selected")); return;}
|
||||
|
||||
double length = sqrt( CGAL::squared_distance(p1,p2).to_double() );
|
||||
double length = sqrt( CGAL::to_double(CGAL::squared_distance(p1,p2)) );
|
||||
char message[50];
|
||||
if (fn==0)
|
||||
sprintf(message,"Distance between marks is %f in ipe pts",length);
|
||||
|
|
|
|||
|
|
@ -185,10 +185,10 @@ void hyperbolicIpelet::protected_run(int fn)
|
|||
// translate so that Poincare : x^2+y^2=A
|
||||
// and selected : x^2+y^2 -2ax -2by +a^2+ b^2=C
|
||||
// look for l so that l.Poincare + selected has zero radius
|
||||
double a=selected.center().x().to_double()-poincare.center().x().to_double();
|
||||
double b=selected.center().y().to_double()-poincare.center().y().to_double();
|
||||
double C=selected.squared_radius().to_double();
|
||||
double A=poincare.squared_radius().to_double();
|
||||
double a=CGAL::to_double(selected.center().x())-CGAL::to_double(poincare.center().x());
|
||||
double b=CGAL::to_double(selected.center().y())-CGAL::to_double(poincare.center().y());
|
||||
double C=CGAL::to_double(selected.squared_radius());
|
||||
double A=CGAL::to_double(poincare.squared_radius());
|
||||
double B=A+C-a*a-b*b;
|
||||
double delta=B*B-4*A*C;
|
||||
double l=(-B+sqrt(delta))/2/A;
|
||||
|
|
@ -205,7 +205,7 @@ void hyperbolicIpelet::protected_run(int fn)
|
|||
(p2.center().y()-p1.center().y(),p2.center().x()-p1.center().x());
|
||||
else v=p2.center()-p1.center();
|
||||
Kernel::FT sqr_length=poincare.squared_radius() / v.squared_length();
|
||||
double length = sqrt( sqr_length.to_double());
|
||||
double length = sqrt( CGAL::to_double(sqr_length) );
|
||||
v = Kernel::FT(length)*v;
|
||||
Point_2 q1=poincare.center()+ v;
|
||||
Point_2 q2=poincare.center()- v;
|
||||
|
|
|
|||
Loading…
Reference in New Issue