Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Circular Kernel: clean way to convert from Circular_arc_point_2 to Point_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Circular Kernel: clean way to convert from Circular_arc_point_2 to Point_2


Chronological Thread 
  • From:
  • To:
  • Subject: Re: [cgal-discuss] Circular Kernel: clean way to convert from Circular_arc_point_2 to Point_2
  • Date: Fri, 12 Oct 2007 10:28:34 +0200


wrote:
My problem is the following: I have three points on arcs (therefor circular
arc points), and from these three points I want to construct a circle;
A circle can only be constructed from normal points, so i need to convert the
CAP to points, without loosing the has_on property of these points concerning
their origin arcs;

I see that the conversion from Root_of_2 isn't trivial, and not implemented
yet, anyhow: does someone have an idea how to implement this in a clean /
exact way, if the Root_of_2 number is of rational form?

Hi,

In the current implementation, a Root_of_2 is represented as alpha + beta sqrt(gamma). There is no clever simplification, checking that gamma is a square and simplifying the sqrt.

If your algebraic number is actually rational (if I understand correctly, this is the case for your question), then it basically means that the number is equal to alpha. There is an [undocumented] access function alpha() that returns an element of the underlying field number type FT. beta() and gamma() are also provided.
This should allow you to do what you need and construct a Point_2< Cartesian<FT> >.

If the number is not rational, the access functions alpha(), beta(), gamma() can be used to construct a CORE::Expr.

As usual, using undocumented functions is not completely safe since they are not part of the specifications and may change in the future. But I guess these access functions should perhaps be documented...

Best,
Monique Teillaud



Archive powered by MHonArc 2.6.16.

Top of Page