2

Circle-Line Intersection

 1 year ago
source link: https://mathworld.wolfram.com/Circle-LineIntersection.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Circle-Line Intersection


CircleLineIntersection

An (infinite) line determined by two points (x_1,y_1) and (x_2,y_2) may intersect a circle of radius r and center (0, 0) in two imaginary points (left figure), a degenerate single point (corresponding to the line being tangent to the circle; middle figure), or two real points (right figure).

In geometry, a line meeting a circle in exactly one point is known as a tangent line, while a line meeting a circle in exactly two points in known as a secant line (Rhoad et al. 1984, p. 429).

Defining

d_x=x_2-x_1
d_y=y_2-y_1
d_r=sqrt(d_x^2+d_y^2)
D=|x_1 x_2; y_1 y_2|=x_1y_2-x_2y_1

gives the points of intersection as

x=(Dd_y+/-sgn^*(d_y)d_xsqrt(r^2d_r^2-D^2))/(d_r^2)
y=(-Dd_x+/-|d_y|sqrt(r^2d_r^2-D^2))/(d_r^2),

where the function sgn^*(x) is defined as

sgn^*(x)={-1   for x<0; 1   otherwise.

The discriminant

Delta=r^2d_r^2-D^2

therefore determines the incidence of the line and circle, as summarized in the following table.

Deltaincidence
Delta<0no intersection
Delta=0tangent
Delta>0intersection


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK