Sutherland-Hodgman polygon clipping: Difference between revisions
Content added Content deleted
Line 3,299: | Line 3,299: | ||
=={{header|Mercury}}== |
=={{header|Mercury}}== |
||
{{trans|ATS}} |
{{trans|ATS}} |
||
{{works with|Mercury|22.01.1}} |
|||
<syntaxhighlight lang="mercury"> |
<syntaxhighlight lang="mercury"> |
||
:- module sutherland_hodgman_task. |
:- module sutherland_hodgman_task. |
||
Line 3,555: | Line 3,556: | ||
%%% end: |
%%% end: |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{out}} |
|||
<pre>mmc sutherland_hodgman_task.m && ./sutherland_hodgman_task |
|||
(100.0, 116.66666666666669) |
|||
(124.99999999999999, 100.0) |
|||
(275.0, 100.0) |
|||
(300.0, 116.66666666666667) |
|||
(300.0, 300.0) |
|||
(250.0, 300.0) |
|||
(200.0, 250.0) |
|||
(175.0, 300.0) |
|||
(125.0, 300.0) |
|||
(100.0, 250.0) |
|||
Wrote sutherland-hodgman.eps</pre> |
|||
[[File:Sutherland-hodgman-from-mercury.png|alt=The polygons as generated by a Mercury program.]] |
|||
=={{header|Modula-2}}== |
=={{header|Modula-2}}== |