Ray-casting algorithm: Difference between revisions
Content added Content deleted
m (→{{header|Python}}: Expose all defs in scrolling window (for firefox on Windows at least).) |
(→{{header|Python}}: scrolling: use em, not ex, since em is defined to be equal to the font line height and so will be more consistent) |
||
Line 704: | Line 704: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
<div style="height: |
<div style="height:50em;overflow:scroll"><lang python>from collections import namedtuple |
||
from pprint import pprint as pp |
from pprint import pprint as pp |
||
import sys |
import sys |
||
Line 808: | Line 808: | ||
'''Sample output''' |
'''Sample output''' |
||
<pre style="height: |
<pre style="height:20em;overflow:scroll"> |
||
TESTING WHETHER POINTS ARE WITHIN POLYGONS |
TESTING WHETHER POINTS ARE WITHIN POLYGONS |
||
Line 861: | Line 861: | ||
'''Helper routine to convert Fortran Polygons and points to Python''' |
'''Helper routine to convert Fortran Polygons and points to Python''' |
||
<div style="height: |
<div style="height:20em;overflow:scroll"> |
||
<lang python>def _convert_fortran_shapes(): |
<lang python>def _convert_fortran_shapes(): |
||
point = Pt |
point = Pt |