Untitled
unknown
plain_text
2 years ago
4.5 kB
5
Indexable
radius=1; % in meter c_offsetx=0; c_offsety=0; t = linspace(0,2*pi,7); %center cell t = linspace(0,2*pi,7); %center cell c_x1 = 0+c_offsetx; %BS Location Center Cell x-axis c_y1 = 0;%BS Location Center Cell y-axis x1 = c_x1 + radius*cos(t); y1 = c_y1 + radius*sin(t); plot(x1,y1); hold on %% % Upper cell c_x2 = 0+c_offsetx; %BS Location Upper cell Cell x-axis c_y2 = ((sqrt(3)/2)*2*radius);%BS Location Upper cell y-axis x2=c_x2 +radius*cos(t); y2 = c_y2+ (radius*sin(t)); plot(x2,y2); %% % Lower cell c_x3 = 0+c_offsetx; %BS Location Lower cell Cell x-axis c_y3 = -((sqrt(3)/2)*2*radius);%BS Location Lower cell y-axis x3=c_x3 +radius*cos(t); y3 = c_y3 + (radius*sin(t)); plot(x3,y3) %% %Right Upper cell c_x4 = (radius+(radius/2))+c_offsetx; %BS Location Right Upper cell x-axis c_y4 = ((sqrt(3)/2)*radius);%BS Location Right Upper cell y-axis x4= c_x4+ radius*cos(t); y4 = c_y4 + (radius*sin(t)); plot(x4,y4); %% %Right Lower cell c_x5 = (radius+(radius/2))+c_offsetx; %BS Location Right Lower cell x-axis c_y5 = -((sqrt(3)/2)*radius);%BS Location Right Lower cell y-axis x5= c_x5+ radius*cos(t); y5 = c_y5 + (radius*sin(t)); plot(x5,y5); %% %Left Upper cell c_x6 = -(radius+(radius/2))+c_offsetx; %BS Location Right Lower cell x-axis c_y6 = ((sqrt(3)/2)*radius); %BS Location Right Lower cell y-axis x6= c_x6 + radius*cos(t); y6 = c_y6 + (radius*sin(t)); plot(x6,y6); %% %Left Lower cell c_x7 = -(radius+(radius/2))+c_offsetx; %BS Location Left Lower cell x-axis c_y7 = -((sqrt(3)/2)*radius); %BS Location Left Lower cell y-axis x7= c_x7 + radius*cos(t); y7 = c_y7 + (radius*sin(t)); plot(x7,y7); BS_locations_x = [c_x1 c_x4 c_x2 c_x6 c_x7 c_x3 c_x5]; BS_locations_y = [c_y1 c_y4 c_y2 c_y6 c_y7 c_y3 c_y5]; cells_x = [x1; x4; x2; x6; x7; x3; x5]; cells_y = [y1; y4; y2; y6; y7; y3; y5]; %plot(cells_x(:),cells_y(:)); hold on plot(BS_locations_x,BS_locations_y,'r+') bs = [BS_locations_x' BS_locations_y' ]; rdash=((sqrt(3)/2)*radius); c_offsetx=4*rdash*cos(pi/6); c_offsety=(4*rdash*sin(pi/6))+(2*rdash); t = linspace(0,2*pi,7); %center cell t = linspace(0,2*pi,7); %center cell c_x1 = 0+c_offsetx; %BS Location Center Cell x-axis c_y1 = 0+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Center Cell y-axis x1 = c_x1 + radius*cos(t); y1 = c_y1 + radius*sin(t); plot(x1,y1); %% % Upper cell c_x2 = 0+c_offsetx; %BS Location Upper cell Cell x-axis c_y2 = ((sqrt(3)/2)*2*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Upper cell y-axis x2=c_x2 +radius*cos(t); y2 = c_y2+ (radius*sin(t)); plot(x2,y2); %% % Lower cell c_x3 = 0+c_offsetx; %BS Location Lower cell Cell x-axis c_y3 = -((sqrt(3)/2)*2*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Lower cell y-axis x3=c_x3 +radius*cos(t); y3 = c_y3 + (radius*sin(t)); plot(x3,y3) %% %Right Upper cell c_x4 = (radius+(radius/2))+c_offsetx; %BS Location Right Upper cell x-axis c_y4 = ((sqrt(3)/2)*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Right Upper cell y-axis x4= c_x4+ radius*cos(t); y4 = c_y4 + (radius*sin(t)); plot(x4,y4); %% %Right Lower cell c_x5 = (radius+(radius/2))+c_offsetx; %BS Location Right Lower cell x-axis c_y5 = -((sqrt(3)/2)*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Right Lower cell y-axis x5= c_x5+ radius*cos(t); y5 = c_y5 + (radius*sin(t)); plot(x5,y5); %% %Left Upper cell c_x6 = -(radius+(radius/2))+c_offsetx; %BS Location Right Lower cell x-axis c_y6 = ((sqrt(3)/2)*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Right Lower cell y-axis x6= c_x6 + radius*cos(t); y6 = c_y6 + (radius*sin(t)); plot(x6,y6); %% %Left Lower cell c_x7 = -(radius+(radius/2))+c_offsetx; %BS Location Left Lower cell x-axis c_y7 = -((sqrt(3)/2)*radius)+(4*rdash*sin(pi/6))+(2*rdash); %BS Location Left Lower cell y-axis x7= c_x7 + radius*cos(t); y7 = c_y7 + (radius*sin(t)); plot(x7,y7); BS_locations_x = [c_x1 c_x4 c_x2 c_x6 c_x7 c_x3 c_x5]; BS_locations_y = [c_y1 c_y4 c_y2 c_y6 c_y7 c_y3 c_y5]; cells_x = [x1; x4; x2; x6; x7; x3; x5]; cells_y = [y1; y4; y2; y6; y7; y3; y5]; %plot(cells_x(:),cells_y(:)); hold on plot(BS_locations_x,BS_locations_y,'r+') bs = [BS_locations_x' BS_locations_y' ];
Editor is loading...