Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off & setlocal enableDelayedExpansion
- set ^"LF=^
- ^" Above empty line is required - do not remove
- set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
- set /a "hei=50", "wid=50", "heiXwid=hei * wid"
- for /l %%a in (1,1,%heiXwid%) do set "canvas=!canvas! "
- mode con: cols=%wid% lines=%hei%
- set "_SIN=a-a*a/1920*a/312500+a*a/1920*a/15625*a/15625*a/2560000-a*a/1875*a/15360*a/15625*a/15625*a/16000*a/44800000"
- set "SIN(x)=(a=(x * 31416 / 180)%%62832, c=(a>>31|1)*a, a-=(((c-47125)>>31)+1)*((a>>31|1)*62832) + (-((c-47125)>>31))*( (((c-15709)>>31)+1)*(-(a>>31|1)*31416+2*a) ), %_SIN%) / 10000"
- set "COS(x)=(a=(15708 - x * 31416 / 180)%%62832, c=(a>>31|1)*a, a-=(((c-47125)>>31)+1)*((a>>31|1)*62832) + (-((c-47125)>>31))*( (((c-15709)>>31)+1)*(-(a>>31|1)*31416+2*a) ), %_SIN%) / 10000"
- set plot=for %%# in (1 2) do if %%#==2 ( for /f "tokens=1-3" %%1 in ("^!args^!") do (%\n%
- set /a "_x=%%~1 + (%%~2 * wid)", "_y=1 + %%~1 + (%%~2 * wid)"%\n%
- for /f "tokens=1-3" %%a in ("^!_x^! ^!_y^! ^!heiXwid^!") do set "canvas=^!canvas:~0,%%a^!%%~3^!canvas:~%%b,%%c^!"%\n%
- )) else set args=
- for /l %%e in () do (
- set /a "angle+=1", "x=20 * !cos(x):x=5 * angle! * !sin(x):x=angle! + wid / 2", "y=20 * !cos(x):x=5 * angle! * !cos(x):x=angle! + hei / 2"
- %plot% x y x
- echo=!canvas!
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement