Animate a pendulum: Difference between revisions
m
→{{header|Amazing Hopper}}
Line 261:
</pre>
<pre>
FALSE MODE GRAPHICS.
You can simulate a pseudo graphical mode in an Ubuntu Linux terminal by adding the following lines:
</pre>
<lang Amazing Hopper>
SYS("gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font 'Ubuntu Mono 1'")
CLR-SCR
HIDE-CURSOR
GOSUB( Animate a Pendulum )
SYS("gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font 'Ubuntu Mono 12'")
SHOW-CURSOR
</lang>
<pre>
And substituting the holding coordinates of the pendulum:
</pre>
<lang Amazing Hopper>
// in "Animate a Pendulum"
SET( px, 640 )//65 )
SET( py, 30 ) //7 )
// long of the line:
LET( bx := ADD( px, MUL( MUL( l, 180 ), SIN(theta) ) ) )
LET( by := SUB( py, MUL( MUL( l, 180 ), COS(theta) ) ) )
// and circle ratio:
{bx, by, 10} GOSUB( CIRCLE )
</lang>
=={{header|AutoHotkey}}==
|