next up previous contents index
Next: Real Triangles ( real_triangle Up: Basic Data Types for Previous: Straight Real Lines (   Contents   Index


Real Circles ( real_circle )

Definition

An instance C of the data type real_circle is an oriented circle in the plane passing through three points p1 , p2 , p3 . The orientation of C is equal to the orientation of the three defining points, i.e. orientation(p1, p2, p3) . If |   {p1, p2, p3}   | = 1 C is the empty circle with center p1 . If p1, p2, p3 are collinear C is a straight line passing through p1 , p2 and p3 in this order and the center of C is undefined.

#include < LEDA/geo/real_circle.h >

Types

real_circle::coord_type the coordinate type (real).

real_circle::point_type the point type (real_point).

Creation

real_circle C(const real_point& a, const real_point& b, const real_point& c)
    introduces a variable C of type real_circle. C is initialized to the oriented circle through points a , b , and c .

real_circle C(const real_point& a, const real_point& b)
    introduces a variable C of type real_circle. C is initialized to the counter-clockwise oriented circle with center a passing through b .

real_circle C(const real_point& a) introduces a variable C of type real_circle. C is initialized to the trivial circle with center a .

real_circle C introduces a variable C of type real_circle. C is initialized to the trivial circle with center (0, 0) .

real_circle C(const real_point& c, real r)
    introduces a variable C of type real_circle. C is initialized to the circle with center c and radius r with positive (i.e. counter-clockwise) orientation.

real_circle C(real x, real y, real r) introduces a variable C of type real_circle. C is initialized to the circle with center (x, y) and radius r with positive (i.e. counter-clockwise) orientation.

real_circle C(const circle& c, int prec = 0)
    introduces a variable C of type real_circle initialized to the circle c . (The second argument is for compatibility with rat_circle.)

real_circle C(const rat_circle& c) introduces a variable C of type real_circle initialized to the circle c .

Operations

real_point C.center() returns the center of C.
Precondition The orientation of C is not 0 .

real C.radius() returns the radius of C.
Precondition The orientation of C is not 0 .

real C.sqr_radius() returns the squared radius of C.
Precondition The orientation of C is not 0 .

real_point C.point1() returns p1 .

real_point C.point2() returns p2 .

real_point C.point3() returns p3 .

bool C.is_degenerate() returns true if the defining points are collinear.

bool C.is_trivial() returns true if C has radius zero.

bool C.is_line() returns true if C is a line.

real_line C.to_line() returns line(point1(), point3()).

int C.orientation() returns the orientation of C.

int C.side_of(const real_point& p)
    returns -1 , +1 , or 0 if p lies right of, left of, or on C respectively.

bool C.inside(const real_point& p)
    returns true iff p lies inside of C.

bool C.outside(const real_point& p)
    returns true iff p lies outside of C.

bool C.contains(const real_point& p)
    returns true iff p lies on C.

real_circle C.translate(real dx, real dy)
    returns C translated by vector (dx, dy) .

real_circle C.translate(const real_vector& v)
    returns C translated by vector v .

real_circle C + const real_vector& v returns C translated by vector v .

real_circle C - const real_vector& v returns C translated by vector - v .

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

real_circle C.reflect(const real_point& p, const real_point& q)
    returns C reflected across the straight line passing through p and q .

real_circle C.reflect(const real_point& p)
    returns C reflected across point p .

real_circle C.reverse() returns C reversed.

list< real_point> C.intersection(const real_circle& D)
    returns C $ \cap$ D as a list of points.

list< real_point> C.intersection(const real_line& l)
    returns C $ \cap$ l as a list of (zero, one, or two) points sorted along l .

list< real_point> C.intersection(const real_segment& s)
    returns C $ \cap$ s as a list of (zero, one, or two) points sorted along s .

real_segment C.left_tangent(const real_point& p)
    returns the line segment starting in p tangent to C and left of segment [p,C.center()].

real_segment C.right_tangent(const real_point& p)
    returns the line segment starting in p tangent to C and right of segment [p,C.center()].

real C.distance(const real_point& p)
    returns the distance between C and p .

real C.sqr_dist(const real_point& p)
    returns the squared distance between C and p .

real C.distance(const real_line& l)
    returns the distance between C and l .

real C.distance(const real_circle& D)
    returns the distance between C and D .

bool radical_axis(const real_circle& C1, const real_circle& C2, real_line& rad_axis)
    if the radical axis for C1 and C2 exists, it is assigned to rad_axis and true is returned; otherwise the result is false.


next up previous contents index
Next: Real Triangles ( real_triangle Up: Basic Data Types for Previous: Straight Real Lines (   Contents   Index
Christian Uhrig 2017-04-07