Arborescent曲线

讲道理,我不确定有没有这东西,不过名字什么的并不重要。

以钝角三角形为单位,将原三角形中间减一个裂口,分为两个与原三角形相似的小三角形,不断重复下去得到Arborescent曲线。


function draw_Arborescent_Curve(P1, P2, P3, N, options)

% Arboresent_Curve 的基本单位是等腰钝角三角形
% P1是三角形顶点(必须是1*2的向量),P2,P3 是底边的两端点,N是递归层数
% options(1):线段宽度
% options(2:4):线段颜色

default_options = [3 0 1 0];
if nargin == 4
	options = default_options;
end
LineWidth = options(1);
Color = options(2:4);

if N == 1
    plot([P1(1) P2(1) P3(1) P1(1)], [P1(2) P2(2) P3(2) P1(2)], ...
        'Color', Color, 'LineWidth', LineWidth, 'EraseMode', 'none');
else
    mid = (P3 - P2) * sum((P1-P2).^2) / sum((P2-P3).^2);
    L = P2 + mid;
    R = P3 - mid;
    draw_Arboresent_Curve(L, P2, P1, N-1, options);
    draw_Arboresent_Curve(R, P3, P1, N-1, options);
end

两条对称的Arborescent曲线就构成了Arborescent肺。


function Arborescent_Lung(N)

% N 是迭代次数

fig = figure('NumberTitle','off','name','Arborescent肺','MenuBar','none');
set(fig, 'color', [255 235 215]/255);

axis equal;
axis off; hold on;

alpha = pi/25;
beta = pi*2/9;
A = [cos(beta) sin(beta); -sin(beta) cos(beta) ];
P1 = [sin(alpha+beta) cos(alpha+beta)];
P2 = [0 0];
P3 = P1 * A * 2*cos(beta);

draw_Arborescent_Curve(P1, P2, P3, N);
draw_Arborescent_Curve(P1.*[-1 1], P2.*[-1 1], P3.*[-1 1], N);

其实仔细观察一下,Arborescent曲线就是扩展的Kohn曲线。


fig = figure('NumberTitle','off','name','对比','MenuBar','none');
set(fig, 'color', [255 235 215]/255);

axis equal;
axis off; hold on;

alpha = pi/25;
beta = pi*2/9;

draw_Kohn_Curve([sin(alpha) cos(alpha)], [0 0], N, [3 2*beta 0 1 0]);
draw_Kohn_Curve([0 0], [-sin(alpha) cos(alpha)], N, [3 2*beta 0 1 0]);


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值