标题: [特效代码] 分形图:Gosper curve [打印本页]
作者: a20150604 时间: 2017-5-6 21:01 标题: 分形图:Gosper curve
本帖最后由 a20150604 于 2017-5-6 21:20 编辑
- @echo off & setlocal enableDelayedExpansion
-
- set "SIN=(t-t*t/1875*t/320000+t*t/1875*t/15625*t/16000*t/2560000-t*t/1875*t/15360*t/15625*t/15625*t/16000*t/44800000)"
- set "COS=(10000-t*t/20000+t*t/1875*t/15625*t/819200-t*t/1875*t/15360*t/15625*t/15625*t/10240000+t*t/1875*t/15360*t/15625*t/15625*t/16000*t/15625*t/229376000)"
-
- set /a "p=31416, p2=62832, pn2=-62832, p#2=15708, p3#2=47124, p3#2_=p3#2-1"
-
- REM 角度运算
- set /a "EA=EB=0"
- set "EL=a+=60,a%%=360"
- set "EM=a+=120,a%%=360"
- set "ER=a-=60,t=a>>31,a+=(t&360|~t&0),a%%=360"
- set "ES=a-=120,t=a>>31,a+=(t&360|~t&0),a%%=360"
-
- set /a "margin=100000, xs=100000, ys=1739896, hei=4759696, wid=4495856"
-
- set "C=A" & echo;C=!C!
-
- set /a "a=90, r1=10000, r2=0"
- set /a "iterations=4, imax=4573-1, y=ys, x=xs"
-
- for /L %%i in (1 1 !iterations!) do (
-
- set "C=!C:A=U!"
- set "C=!C:B=V!"
-
- set "C=!C:U=ARBSBLAMAALBR!"
- set "C=!C:V=LARBBSBRAMALB!"
-
- set "C=!C:RL=!"
- set "C=!C:RR=S!"
- set "C=!C:LL=M!"
-
- echo;C=!C!
- )
- set "C=!C:B=A!"
-
- <nul >Gosper_curve.htm (
-
- echo;^<svg height="!hei:~0,-4!" width="!wid:~0,-4!"^>
- set /p "=<polyline points=""
-
- set /p "=!x:~0,-4!.!x:~-4!,!y:~0,-4!.!y:~-4! "
-
- for /L %%i in (0 1 !imax!) do (
- for %%m in ("!C:~%%i,1!") do (
-
- set /a "!E%%~m!"
-
- if not "%%~m"=="A" (
-
- set /a "t=a*p/180"
- set /a "s1=(t-p#2^t-p3#2)>>31, s3=p3#2_-t>>31, t=(-t&s1)+(t&~s1)+(p&s1)+(pn2&s3), r1=%SIN%"
- set /a "t=%COS%, r2=(-t&s1)+(t&~s1)"
-
- ) else (
-
- set /a "y-=r1*8, x+=r2*8"
- set /p "=!x:~0,-4!.!x:~-4!,!y:~0,-4!.!y:~-4! "
-
- )
- )
- )
- echo;"
- set /p "=style="fill:none;stroke:blue;stroke-width:1"/>"
- echo;Sorry, your browser does not support inline SVG.
- echo;^</svg^>
- )
-
- start "" Gosper_curve.htm
-
- title any key to exit...
- >nul pause
-
- exit /b
复制代码
作者: 523066680 时间: 2017-5-6 21:30
沙发,前排。(沙发、板凳以后的无实质技术探讨的评论都是灌水。
作者: a20150604 时间: 2017-5-6 21:38
HAHAHA~~~~
作者: codegay 时间: 2017-5-6 21:51
发错了。放原创区去吧。
作者: a20150604 时间: 2017-5-6 22:21
回复 4# codegay
有兴趣的码友能看到就行了, Thanks!
作者: CrLf 时间: 2017-5-6 23:31
棒棒哒
作者: 老刘1号 时间: 2017-5-7 18:01
回复 5# a20150604
仰望大佬
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |