[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[特效代码] 分形图:Gosper curve

本帖最后由 a20150604 于 2017-5-6 21:20 编辑

  1. @echo off & setlocal enableDelayedExpansion
  2. 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)"
  3. 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)"
  4. set /a "p=31416, p2=62832, pn2=-62832, p#2=15708, p3#2=47124, p3#2_=p3#2-1"
  5. REM 角度运算
  6. set /a "EA=EB=0"
  7. set "EL=a+=60,a%%=360"
  8. set "EM=a+=120,a%%=360"
  9. set "ER=a-=60,t=a>>31,a+=(t&360|~t&0),a%%=360"
  10. set "ES=a-=120,t=a>>31,a+=(t&360|~t&0),a%%=360"
  11. set /a "margin=100000, xs=100000, ys=1739896, hei=4759696, wid=4495856"
  12. set "C=A" & echo;C=!C!
  13. set /a "a=90, r1=10000, r2=0"
  14. set /a "iterations=4, imax=4573-1, y=ys, x=xs"
  15. for /L %%i in (1 1 !iterations!) do (
  16.     set "C=!C:A=U!"
  17.     set "C=!C:B=V!"
  18.     set "C=!C:U=ARBSBLAMAALBR!"
  19.     set "C=!C:V=LARBBSBRAMALB!"
  20.     set "C=!C:RL=!"
  21.     set "C=!C:RR=S!"
  22.     set "C=!C:LL=M!"
  23.     echo;C=!C!
  24. )
  25. set "C=!C:B=A!"
  26. <nul >Gosper_curve.htm (
  27.     echo;^<svg height="!hei:~0,-4!" width="!wid:~0,-4!"^>
  28.             set /p "=<polyline points=""
  29.             set /p "=!x:~0,-4!.!x:~-4!,!y:~0,-4!.!y:~-4! "
  30.             for /L %%i in (0 1 !imax!) do (
  31.                 for %%m in ("!C:~%%i,1!") do (
  32.                     set /a "!E%%~m!"
  33.                     if not "%%~m"=="A" (
  34.                         set /a "t=a*p/180"
  35.                         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%"
  36.                         set /a "t=%COS%, r2=(-t&s1)+(t&~s1)"
  37.                     ) else (
  38.                         set /a "y-=r1*8, x+=r2*8"
  39.                         set /p "=!x:~0,-4!.!x:~-4!,!y:~0,-4!.!y:~-4! "
  40.                     )
  41.                 )
  42.             )
  43.             echo;"
  44.             set /p "=style="fill:none;stroke:blue;stroke-width:1"/>"
  45.             echo;Sorry, your browser does not support inline SVG.
  46.     echo;^</svg^>
  47. )
  48. start "" Gosper_curve.htm
  49. title any key to exit...
  50. >nul pause
  51. exit /b
复制代码
1

评分人数

    • CrLf: 感谢分享技术 + 1

沙发,前排。(沙发、板凳以后的无实质技术探讨的评论都是灌水。

TOP

HAHAHA~~~~

TOP

发错了。放原创区去吧。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 4# codegay

有兴趣的码友能看到就行了, Thanks!

TOP

棒棒哒

TOP

回复 5# a20150604


    仰望大佬

TOP

返回列表