Line circle intersection: Difference between revisions

→‎{{header|Go}}: Added stretch goal.
(→‎{{header|Wren}}: Added stretch goal.)
(→‎{{header|Go}}: Added stretch goal.)
Line 982:
fmt.Println("\n a segment starting at (7, 4) and ending at (11, 8) is/are:")
fmt.Println(" ", intersects(point{7, 4}, point{11, 8}, cp, r, true))
cp = point{10, 10}
r = 5.0
fmt.Println("\n A circle, center (10, 10) with radius 5, and:")
fmt.Println("\n a vertical line containing the points (5, 0) and (5, 20) is/are:")
fmt.Println(" ", intersects(point{5, 0}, point{5, 20}, cp, r, false))
fmt.Println("\n a horizontal segment starting at (-5, 10) and ending at (5, 10) is/are:")
fmt.Println(" ", intersects(point{-5, 10}, point{5, 10}, cp, r, true))
}</syntaxhighlight>
 
Line 1,014 ⟶ 1,021:
a segment starting at (7, 4) and ending at (11, 8) is/are:
[(8, 5)]
 
A circle, center (10, 10) with radius 5, and:
 
a vertical line containing the points (5, 0) and (5, 20) is/are:
[(5, 10)]
 
a horizontal segment starting at (-5, 10) and ending at (5, 10) is/are:
[(5, 10)]
</pre>
 
9,490

edits