15,918,976 members
1.00/5 (1 vote)
See more:
I have following formulas to find intersect points of Line and Circle

x = {-B + sqrt[((B^2) - 4AC)]} / 2A

where B = 2mc
A = 1 + m^2
C = c^2 - r^2

m means slop
c means Constant of line formula

after finding x I find value of y by putting x in (y = mx + c)
but what we have to do when slop is infinite (means vertical line)
?
Posted
Updated 4-Oct-10 0:34am
v2

Solution 1

A vertical line as equation
```x = K
```

where `K` is a const.
Hence, you've to solve the original equation for `y`, namely:
`(K-a)^2 + (y-b)^2 = r^2`

That is, again, just a quadratic equation.
:)

v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 OriginalGriff 128 Pete O'Hanlon 120 Dave Kreskowiak 40 Wendelius 40 Richard Deeming 40
 Pete O'Hanlon 840 OriginalGriff 711 Dave Kreskowiak 445 Richard MacCutchan 320 merano99 260

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900