Plot coordinate pairs: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
|||
Line 1,259: | Line 1,259: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
[https://easylang.online/apps/_plot_coord.html Run it] |
[https://easylang.online/apps/_plot_coord.html Run it] |
||
<syntaxhighlight lang="text"> |
<syntaxhighlight lang="text"> |
||
x[] = [ 0 1 2 3 4 5 6 7 8 9 ] |
|||
y[] = [ 2.7 2.8 31.4 38.1 58.0 76.2 100.5 130.0 149.3 180.0 ] |
y[] = [ 2.7 2.8 31.4 38.1 58.0 76.2 100.5 130.0 149.3 180.0 ] |
||
# |
# |
||
Line 1,270: | Line 1,271: | ||
n = len x[] |
n = len x[] |
||
m = 0 |
m = 0 |
||
for i |
for i = 1 to n |
||
if y[i] > m |
|||
m = y[i] |
|||
. |
|||
. |
. |
||
linewidth 0.1 |
linewidth 0.1 |
||
sty = m div 9 |
sty = m div 9 |
||
for i |
for i = 0 to 9 |
||
move 2 94 - i * 10 |
move 2 94 - i * 10 |
||
text i * sty |
text i * sty |
||
Line 1,281: | Line 1,284: | ||
line 95 95 - i * 10 |
line 95 95 - i * 10 |
||
. |
. |
||
stx = x[n |
stx = x[n] div 9 |
||
for i |
for i = 0 to 9 |
||
move i * 9 + 10 96.5 |
move i * 9 + 10 96.5 |
||
text i * stx |
text i * stx |
||
Line 1,290: | Line 1,293: | ||
color 900 |
color 900 |
||
linewidth 0.5 |
linewidth 0.5 |
||
for i |
for i = 1 to n |
||
x = x[i] * 9 / stx + 10 |
x = x[i] * 9 / stx + 10 |
||
y = 100 - (y[i] / sty * 10 + 5) |
y = 100 - (y[i] / sty * 10 + 5) |
||
if i = |
if i = 1 |
||
move x y |
move x y |
||
else |
else |
||
line x y |
line x y |
||
. |
. |
||
. |
|||
</syntaxhighlight> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |