码迷,mamicode.com
首页 > 其他好文 > 详细

Random Process Modeling_1

时间:2020-02-20 10:21:47      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:hold   idt   triangle   图片   alt   rds   ber   nbsp   draw   

1. Bertrand Triangle

r=1; %circle radius
x0=0; y0=0; %centre of circle
%points for circle
t=linspace(0,2*pi,200);
xp=r*cos(t); yp=r*sin(t);
%angles of triangle corners
thetaTri1=2*pi*rand(1);
thetaTri2=thetaTri1+2*pi/3;
thetaTri3=thetaTri1-2*pi/3;
%points for equalateral triangle
xTri1=x0+r*cos(thetaTri1);y1=x0+r*sin(thetaTri1);
xTri2=x0+r*cos(thetaTri2);y2=x0+r*sin(thetaTri2);
xTri3=x0+r*cos(thetaTri3);y3=x0+r*sin(thetaTri3);
%angles of chords 
thetaChord1=2*pi*rand(1);
thetaChord2=2*pi*rand(1);
%points chord
xChord1=x0+r*cos(thetaChord1);yChord1=x0+r*sin(thetaChord1);
xChord2=x0+r*cos(thetaChord2);yChord2=x0+r*sin(thetaChord2);
%Plotting
%draw circle
plot(x0+xp,y0+yp,‘k‘,‘LineWidth‘,2);hold on;
axis square; 
axis tight;
xticks([]);yticks([]);
%draw triangle
plot([xTri1,xTri2],[y1,y2],‘k‘,‘LineWidth‘,2);
plot([xTri2,xTri3],[y2,y3],‘k‘,‘LineWidth‘,2);
plot([xTri3,xTri1],[y3,y1],‘k‘,‘LineWidth‘,2);
%draw chord
plot([xChord1,xChord2],[yChord1,yChord2],‘r‘,‘LineWidth‘,2);

技术图片

 

Random Process Modeling_1

标签:hold   idt   triangle   图片   alt   rds   ber   nbsp   draw   

原文地址:https://www.cnblogs.com/sophhhie/p/12334191.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!