next up previous contents index
Next: Segment of Rational Circle Up: Basic Data Types for Previous: Point Generators ( point   Contents   Index


Point on Rational Circle ( r_circle_point )

Definition

An instance p of type r_circle_point is a point in the two-dimensional plane that can be obtained by intersecting a rational circle c and a rational line l (cf. Sections rat_circle and rat_line). Note that c and l may intersect in two points p1 and p2. Assume that we order these intersections along the (directed) line l. Then p is uniquely determined by a triple (c, l, which), where which is either first or second. Observe that the coordinates of p are in general non-rational numbers (because their computation involves square roots). Therefore the class r_circle_point is derived from real_point (see Section real_point), which means that all operations of real_point are available.

#include < LEDA/geo/r_circle_point.h >

Types

r_circle_point::tag { first, second }
  used for selecting between the two possible intersections of a circle and a line.

Creation

r_circle_point p creates an instance p initialized to the point (0,0).

r_circle_point p(const rat_point& rat_pnt)
    creates an instance p initialized to the rational point rat_pnt.

r_circle_point p(const point& pnt) creates an instance p initialized to the point pnt.

r_circle_point p(const rat_circle& c, const rat_line& l, tag which)
    creates an instance p initialized to the point determined by (c, l, which) (see above).

r_circle_point p(const real_point& rp, const rat_circle& c, const rat_line& l, tag which)
    creates an instance p initialized to the real point rp.
Precondition rp is the point described by (c, l, which).

Operations

void p.normalize() simplifies the internal representation of p.

rat_circle p.supporting_circle() returns a rational circle passing through p.

rat_line p.supporting_line() returns a rational line passing through p.

tag p.which_intersection() returns whether p is the first or the second intersection of the supporting circle and the supporting line.

bool p.is_rat_point() returns true, if p can be converted to rat_point. (The value false means ``do not know''.)

const rat_point& p.to_rat_point() converts p to a rat_point.
Precondition is_rat_point returns true.

rat_point p.approximate_by_rat_point()
    approximates p by a rat_point.

r_circle_point p.round(int prec = 0) returns a rounded representation of p. (experimental)

r_circle_point p.translate(rational dx, rational dy)
    returns p translated by vector (dx, dy).

r_circle_point p.translate(const rat_vector& v)
    returns p translated by vector v.

r_circle_point p + const rat_vector& v returns p translated by vector v.

r_circle_point p - const rat_vector& v returns p translated by vector - v.

r_circle_point p.rotate90(const rat_point& q, int i=1)
    returns p rotated about q by an angle of i x 90 degrees. If i > 0 the rotation is counter-clockwise otherwise it is clockwise.

r_circle_point p.reflect(const rat_point& p, const rat_point& q)
    returns p reflected across the straight line passing through p and q.

r_circle_point p.reflect(const rat_point& p)
    returns p reflected across point p.

bool r_circle_point::intersection(const rat_circle& c, const rat_line& l, tag which, real_point& p)
    checks whether (c, l, which) is a valid triple, if so the corresponding point is assigned to the real_point p.

bool r_circle_point::intersection(const rat_circle& c, const rat_line& l, tag which, r_circle_point& p)
    same as above, except for the fact that p is of type r_circle_point.


next up previous contents index
Next: Segment of Rational Circle Up: Basic Data Types for Previous: Point Generators ( point   Contents   Index