Find the intersection of two lines: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Describe approaches (proced/func) and mark library w header) |
|||
Line 1,380: | Line 1,380: | ||
{{Out}} |
{{Out}} |
||
<pre>(5.0, 5.0)</pre> |
<pre>(5.0, 5.0)</pre> |
||
Or, labelling the moving parts a little more, and returning a composable option value containing either a message (in the absence of an intersection), or a pair of coordinates: |
|||
{{Works with|Python|3.7}} |
{{Works with|Python|3.7}} |
||
Find the intersection using a functional approach, by importing [https://docs.python.org/3/library/functools.html functools.reduce] |
|||
<lang python>'''The intersection of two lines.''' |
<lang python>'''The intersection of two lines.''' |
||