网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
12月29日漏签0天
mathcad吧 关注:5,399贴子:28,234
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 6回复贴,共1页
<<返回mathcad吧
>0< 加载中...

完成了UF中的“Spiral 2 Truncated”

  • 只看楼主
  • 收藏

  • 回复
  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
用两天时间,完成了UF中的“Spiral 2 Truncated”

MC效果

UF效果

MC效果

UF效果

MC效果

UF效果


  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
UF代码
Spir2_Trunc-bare {
; Original formula, Spir2_Trunc, by Paul Carlson.
; Modified to remove coloring parts of the formula by Ken Childress.
; 04 June 1999
init:
complex c = @JuliaCoords
z = #pixel
loop:
z = z^2 - c
z = z - real(z) + abs(real(z))
bailout:
|z| < @bailout
default:
title = "Spiral 2 Truncated"
maxiter = 5000
param JuliaCoords
caption = "Julia Set Coordinates"
default = (-0.378083004695,0.227300793319)
hint = "Julia Set Coordinates."
endparam
param bailout
caption = "Bailout Value"
default = 4.0
hint = "The bailout value."
endparam
}


2025-12-29 17:38:48
广告
不感兴趣
开通SVIP免广告
  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
UF着色代码
StalkTraps {
; Paul W. Carlson
; Variant #1 extracted from "R4MndStksM2".
; Variant #2 extracted from "Spir2_Trunc".
; Variant #3 extracted from "Dbl_Expos_Newt1".
; By Ken Childress June 1999.
init:
bool trapped = FALSE
int iter = 0
float range_num = 0
float num_ranges = real(@RangesColors)
float colors_in_range = imag(@RangesColors)
float index_factor = (colors_in_range - 1) / @size
float color_index = 254
; Initialization for Variant #2
bool first = TRUE
; Initialization for Variant #3
float dist = 0
complex c = #pixel
complex sc = sqrt(-(1 / c^2))
loop:
IF @Variant == 0
float zr = real(#z)
float zi = imag(#z)
float dist = abs((zr - 0.5)^2 + (zi - 0.5)^2 - 0.1)
IF !trapped && (dist < @size) && (iter > @skip)
trapped = TRUE
range_num = iter % num_ranges
color_index = index_factor * dist + range_num * colors_in_range
ENDIF
ELSEIF @Variant == 1
float zr = abs(real(#z))
float zi = abs(imag(#z))
IF (zr <= zi)
float dist = zr
ELSE
dist = zi
ENDIF
IF !trapped && (dist < @size) && |#z| < @MaxZ && !first
trapped = TRUE
range_num = iter % num_ranges
color_index = index_factor * dist + range_num * colors_in_range
ENDIF
first = FALSE
ELSEIF @Variant == 2
IF !trapped && iter >= @skip
; Get minimum distance to an axis
IF (abs(real(#z)) <= abs(imag(#z)))
float min_dist = abs(real(#z))
ELSE
min_dist = abs(imag(#z))
ENDIF
;Check for stalk
IF (dist == 0 && min_dist < @size)
dist = min_dist
ENDIF
;Bailout depends on convergence to a root
IF (|#z + c| < @convergence)
trapped = TRUE
ELSEIF (|#z - c| < @convergence)
trapped = TRUE
ELSEIF (|#z + sc| < @convergence)
trapped = TRUE
ELSEIF (|#z - sc| < @convergence)
trapped = TRUE
ENDIF
IF trapped
range_num = iter % num_ranges
color_index = index_factor * dist + range_num * colors_in_range
ENDIF
ENDIF
ENDIF
iter = iter + 1
final:
IF trapped
#index = ((real(color_index)+1) % 256) / 256 + @randomness * real(#random)
ELSE
IF @solid
#solid = TRUE
ELSE
#index = @back_color / 256
ENDIF
ENDIF
default:
title="Stalk Traps"
param Variant
caption = "Stalk Variant"
enum = "Variant #1" "Variant #2" "Variant #3"
default = 0
hint = "The Stalk Trap variant to use."
endparam
param size
caption = "Stalk Width Factor"
default = 2.0
hint = "Controls stalk width."
endparam
param skip
caption = "Iterations to skip"
default = 0
hint = "Iterations to skip. \
This is not used by Variant #2."
endparam
param MaxZ
caption = "Maximum Z"
default = 4.0
hint = "Maximum value of abs(z). \
This is used by only Variant #2."
endparam
param convergence
caption = "Convergence Value"
default = 1.0e-7
hint = "The value to check for convergence. \
This is not used by Variant #1 or Variant #2."
endparam
param RangesColors
caption = "Ranges and Colors"
default = (2,125)
hint = "Number of Color Ranges and Number of Colors in each Range."
endparam
param back_color
caption = "Background Color"
hint = "This is the color used for orbits that aren't trapped. It has \
no effect if the background is solid."
default = 254
min = 0
max = 255
endparam
param solid
caption = "Solid Background"
hint = "If this is enabled orbits that aren't trapped become solid."
default = false
endparam
param randomness
caption = "Random Texture"
default = 0.0
hint = "This adds a random texture to the coloring."
endparam
}


  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
用在一般的Julia集上,也好看



  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼


能以假乱真了哈


  • LNSZDZG
  • 老主顾
    13
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼


  • 月城翁
  • 东家
    15
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
LNSZDZG老师好手段!谢谢了。


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 6回复贴,共1页
<<返回mathcad吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示