Ray-casting algorithm: Difference between revisions

Content added Content deleted
(Added Algol 68)
m (→‎{{header|11l}}: named tuples)
 
Line 79: Line 79:
{{trans|Python}}
{{trans|Python}}


<syntaxhighlight lang="11l">T Pt
<syntaxhighlight lang="11l">T Pt((Float x, Float y))
Float x, y

F (x, y)
.x = x
.y = y

F String()
F String()
R ‘Pt(x=#., y=#.)’.format(.x, .y)
R ‘Pt(x=#., y=#.)’.format(.x, .y)


T Edge
T Edge((Pt a, Pt b))
Pt a, b

F (a, b)
.a = a
.b = b

F String()
F String()
R ‘Edge(a=#., b=#.)’.format(.a, .b)
R ‘Edge(a=#., b=#.)’.format(.a, .b)


T Poly = (String name, [Edge] edges)
T Poly
String name
[Edge] edges

F (name, edges)
.name = name
.edges = edges


V _eps = 0.00001
V _eps = 0.00001