Line circle intersection: Difference between revisions
Content added Content deleted
(Haskell added) |
|||
Line 243: | Line 243: | ||
go x | x < 0 = [] |
go x | x < 0 = [] |
||
go x = if 0 == x then [(u1+a3,v1+b3)] else [(u1+a3,v1+b3),(u2+a3,v2+b3)] |
go x = if 0 == x then [(u1+a3,v1+b3)] else [(u1+a3,v1+b3),(u2+a3,v2+b3)] |
||
sgn :: Double -> Double |
sgn :: Double -> Double |
||
Line 270: | Line 269: | ||
Intersection: Circle (4.0,2.0) 5.0 and Segment (7.0,4.0) (11.0,18.0): [(7.46,5.61)] |
Intersection: Circle (4.0,2.0) 5.0 and Segment (7.0,4.0) (11.0,18.0): [(7.46,5.61)] |
||
</pre> |
</pre> |
||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
<lang perl>use strict; |
<lang perl>use strict; |