爱心曲线公式大全

local r = a*((math.sin(angle) * math.sqrt(math.abs(math.cos(angle)))) / (math.sin(angle) + 1.4142) - 2 * math.sin(angle) + 2)

local x = r * math.cos(angle) -- 计算对应的x值

local z = r * math.sin(angle) +1.5*a -

--曲线公式绘画

local function generateParabola()

local a = 10 -- 控制振幅(增加这个值会使波形更大)

local b = 0.9 -- 控制频率(增加这个值会使波形更密集)

local id = math.random(668, 681) -- 随机选择一个方块ID

local y = 8 -- 固定y坐标为8

local date = 0 -- 方块的时间戳

local step = 0.005 -- θ的步长,减小步长以增加分辨率

local maxR = 200 -- 设置r的最大值,即波形的最大半径

local blocksPerWait = 30 -- 每次等待前生成的方块数

local waitTime = 0.05 -- 每次生成后的等待时间

local theta = 0

local count = 0 -- 计数器,用于跟踪每次生成的方块数

-- 根据需要调整θ的遍历范围和步长

while true do

theta = theta + step

-- local r = a * math.sin(b * theta) -- 计算对应的r值

--local r = a * math.asin(math.tan(b * theta))

-- local r =a * math.cos(b * theta)+a * math.sin(b * theta)

--local r =a * math.cos(b * theta)*math.cos( theta)

-- local r =a * (math.sin(b * theta)*math.sin( theta))

-- local r =a * (math.cos(b * theta)*math.cos( theta))

--local r = a * math.sin(b * theta)

--local r = a * math.sin(b*theta) +b*math.sin(b*theta)

local angle=theta

local r = a*((math.sin(angle) * math.sqrt(math.abs(math.cos(angle)))) / (math.sin(angle) + 1.4142) - 2 * math.sin(angle) + 2)

if r > maxR then

break -- 如果r超过最大半径,则停止生成

end

local x = r * math.cos(theta) -- 计算对应的x值

local z = r * math.sin(theta) +1.5*a -- 计算对应的z值

-- 在计算出的位置放置方块

Block:setBlockAll(math.floor(x), y, math.floor(z), id, date)

count = count + 1 -- 增加计数器

-- 每生成10个方块后等待0.1秒

if count % blocksPerWait == 0 then

threadpool:wait(waitTime)

end

if math.floor(1000*angle) % 1256 == 0 then

id = math.random(668, 681) -- 随机选择一个方块ID

a=a+1

print(angle)

end

end

end

ScriptSupportEvent:registerEvent("Player.ClickBlock", generateParabola)

local r = a*((math.sin(angle) * math.sqrt(math.abs(math.cos(angle)))) / (math.sin(angle) + 1.4142) - 2 * math.sin(angle) + 2)

蝴蝶曲线公式

local r =a * (math.cos(b * theta)*math.cos( theta))

水平双球曲线公式

local r =a * math.cos(b * theta)*math.cos( theta)

反向双球曲线

local r =a * math.cos(b * theta)*math.sin( theta)

相关推荐
好易学·数据结构9 小时前
可视化图解算法56:岛屿数量
数据结构·算法·leetcode·力扣·回溯·牛客网
weixin_lynhgworld12 小时前
从概率游戏到价值创造:盲盒一番赏的透明化革命
游戏
Ashlee_code14 小时前
裂变时刻:全球关税重构下的券商交易系统跃迁路线图(2025-2027)
java·大数据·数据结构·python·云原生·区块链·perl
闻缺陷则喜何志丹15 小时前
【带权的并集查找】 P9235 [蓝桥杯 2023 省 A] 网络稳定性|省选-
数据结构·c++·蓝桥杯·洛谷·并集查找
jie*15 小时前
python(one day)——春水碧于天,画船听雨眠。
开发语言·数据结构·python·算法·线性回归
草莓熊Lotso17 小时前
【LeetCode刷题指南】--数组串联,合并两个有序数组,删除有序数组中的重复项
c语言·数据结构·其他·刷题
weixin_4196583117 小时前
数据结构之B-树
java·数据结构·b树
H_HX_xL_L17 小时前
数据结构的算法分析与线性表<1>
数据结构·算法
overFitBrain17 小时前
数据结构-2(链表)
数据结构
xienda17 小时前
数据结构排序算法总结(C语言实现)
数据结构·算法·排序算法