Advertisement

Line vs. Circle: Fight!

Started by September 23, 1999 06:32 PM
0 comments, last by Joshua Schpok 25 years, 4 months ago
Seemingly simple, yet boggling question:

Given: two points of line segment, point of circle center, circle radius

We are in 2D, here.

How do you determine if and where the line segment is intersecting the circle?

------------------
Oddball Software
http://zap.to/oddball

A circle is defined as the set of points that are all equidistant from one point, which is the center of the circle. So basically, any points on the line that are R units away from the center lie on the circle (R = radius).

The (nonstandard) equations for lines and circles are:

y = mx + b and
(x-h)^2 + (y-k)^2 = r^2

Where m is the slope, and b is the point the line crosses the Y axis.

(h,k) is the center of the circle and R is the radius.

Hope this helps

This topic is closed to new replies.

Advertisement