Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] How to construct a Line_arc_2 from two Circular_arc_point_2 directly?
Chronological Thread
- From: "Pedro Machado Manhães de Castro" <>
- To:
- Subject: Re: [cgal-discuss] How to construct a Line_arc_2 from two Circular_arc_point_2 directly?
- Date: Mon, 20 Oct 2008 16:42:51 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=k8OvRvtDjt10Q8/jy7gtZumlVDb1UhdbvNLPXva2qhvVcqDOAOqyedJb1fO4N0UumK tdZznWwFRR+q1UP1WNLeHbuqug6iLyP33MGbB51Fiwg6xtiROMf3gdvpTAaU0se6tC4O xd8pdYfSjuVHQGUPKQRjYHKhHFxiCTXvViGm8=
On Sun, Oct 19, 2008 at 2:44 PM, <> wrote:
You can't create a line_arc_2 only from 2 circular_arc_point_2 because there is no guarantee the underlying line_2 is rational (has its coefficients rational).
However, when known that you had them by an intersection of 2 circles, you know that the underlying line_2 is rational.
So there is a constructor:
That you should use instead.
The line_2 in question is the radical line from the two circles.
You can have it doing, for example, that:
Circle_2 c1, c2; // your circles
FT a = 2*(c2.center().x() - c1.center().x());
FT b = 2*(c2.center().y() - c1.center().y());
FT c = (c1.center().x()) * (c1.center().x()) +
(c1.center().y()) * (c1.center().y()) - c1.squared_radius() -
(c2.center().x()) * (c2.center().x()) -
(c2.center().y()) * (c2.center().y()) + c2.squared_radius();
Line_2 l = Line_2(a, b, c);
Line_arc_2 la = Line_arc_2(l, p1, p2);
Cheers,
Pedro
I have computed two points from circle intersect, it's type is
Circular_arc_point_2 , How to construct a Line_arc_2?
You can't create a line_arc_2 only from 2 circular_arc_point_2 because there is no guarantee the underlying line_2 is rational (has its coefficients rational).
However, when known that you had them by an intersection of 2 circles, you know that the underlying line_2 is rational.
So there is a constructor:
Line_arc_2<CircularKernel> la ( |
CircularKernel::Line_2 l, CircularKernel::Circular_arc_point_2 p1, CircularKernel::Circular_arc_point_2 p2); |
The line_2 in question is the radical line from the two circles.
You can have it doing, for example, that:
Circle_2 c1, c2; // your circles
FT a = 2*(c2.center().x() - c1.center().x());
FT b = 2*(c2.center().y() - c1.center().y());
FT c = (c1.center().x()) * (c1.center().x()) +
(c1.center().y()) * (c1.center().y()) - c1.squared_radius() -
(c2.center().x()) * (c2.center().x()) -
(c2.center().y()) * (c2.center().y()) + c2.squared_radius();
Line_2 l = Line_2(a, b, c);
Line_arc_2 la = Line_arc_2(l, p1, p2);
Cheers,
Pedro
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] How to construct a Line_arc_2 from two Circular_arc_point_2 directly?, henryho2006, 10/19/2008
- Re: [cgal-discuss] How to construct a Line_arc_2 from two Circular_arc_point_2 directly?, Pedro Machado Manhães de Castro, 10/20/2008
Archive powered by MHonArc 2.6.16.