#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<math.h>
#define SIDE 30
#define PI 3.14159
#define X 300
#define Y 220
void draw_hexagon(int,int);
void recur_draw(int,int,int);
void frequency(int,int);
char *name[]={"Blue","Green","Cyan","Red","Magenta","Brown","Lightgray"};
int count=1;
void main(){
int gd=DETECT,gm;
int k=0,f=0;
initgraph(&gd,&gm,"C:\\TC\\BGI");
printf("Enter the value of Reuse Factor (k) ");
scanf("%d",&k);
printf("Enter the frequency range: ");
scanf("%d",&f);
draw_hexagon(X,Y);
recur_draw(X,Y,k);
frequency(f,k);
getch();
closegraph();
}
void draw_hexagon(int x,int y){
int x1,y1,x2,y2,i;
int degree=0;
x1=x+SIDE*cos((degree*PI)/180);
y1=y+SIDE*sin((degree*PI)/180);
setcolor(WHITE);
setlinestyle(0,0,3);
for(i=1;i<=6;i++){
degree=degree+60;
x2=x+SIDE*cos((degree*PI)/180);
y2=y+SIDE*sin((degree*PI)/180);
line(x1,y1,x2,y2);
x1=x2;
y1=y2;
}
}
void recur_draw(int x,int y,int k){
int x1,y1,i;
int degree=30;
int COLOR=1;
count=count+1;
setfillstyle(SOLID_FILL,COLOR);
floodfill(x-1,y+1,WHITE);
if(COLOR==1 && count==2)
printf("1. %s\n",name[0]);
for(i=1;i<k;i++){
x1=x+1.732*SIDE*cos((degree*PI)/180);
y1=y+1.732*SIDE*sin((degree*PI)/180);
draw_hexagon(x1,y1);
if(COLOR==i && count==2)
printf("%d. %s\n",i+1,name[i]);
COLOR=COLOR+1;
setfillstyle(SOLID_FILL,COLOR);
floodfill(x1-1,y1+1,WHITE);
degree=degree+60;
}
}
void frequency(int f,int k){
int x1,y1,i;
int degree=3.2+(k-3)*1.75;
int D=1.732*sqrt(k)*SIDE;
int p=f/k;
for(i=1;i<p;i++){
x1=X+D*cos((degree*PI)/180);
y1=Y+D*sin((degree*PI)/180);
draw_hexagon(x1,y1);
recur_draw(x1,y1,k);
degree=degree+60;
}
}
#include<graphics.h>
#include<conio.h>
#include<math.h>
#define SIDE 30
#define PI 3.14159
#define X 300
#define Y 220
void draw_hexagon(int,int);
void recur_draw(int,int,int);
void frequency(int,int);
char *name[]={"Blue","Green","Cyan","Red","Magenta","Brown","Lightgray"};
int count=1;
void main(){
int gd=DETECT,gm;
int k=0,f=0;
initgraph(&gd,&gm,"C:\\TC\\BGI");
printf("Enter the value of Reuse Factor (k) ");
scanf("%d",&k);
printf("Enter the frequency range: ");
scanf("%d",&f);
draw_hexagon(X,Y);
recur_draw(X,Y,k);
frequency(f,k);
getch();
closegraph();
}
void draw_hexagon(int x,int y){
int x1,y1,x2,y2,i;
int degree=0;
x1=x+SIDE*cos((degree*PI)/180);
y1=y+SIDE*sin((degree*PI)/180);
setcolor(WHITE);
setlinestyle(0,0,3);
for(i=1;i<=6;i++){
degree=degree+60;
x2=x+SIDE*cos((degree*PI)/180);
y2=y+SIDE*sin((degree*PI)/180);
line(x1,y1,x2,y2);
x1=x2;
y1=y2;
}
}
void recur_draw(int x,int y,int k){
int x1,y1,i;
int degree=30;
int COLOR=1;
count=count+1;
setfillstyle(SOLID_FILL,COLOR);
floodfill(x-1,y+1,WHITE);
if(COLOR==1 && count==2)
printf("1. %s\n",name[0]);
for(i=1;i<k;i++){
x1=x+1.732*SIDE*cos((degree*PI)/180);
y1=y+1.732*SIDE*sin((degree*PI)/180);
draw_hexagon(x1,y1);
if(COLOR==i && count==2)
printf("%d. %s\n",i+1,name[i]);
COLOR=COLOR+1;
setfillstyle(SOLID_FILL,COLOR);
floodfill(x1-1,y1+1,WHITE);
degree=degree+60;
}
}
void frequency(int f,int k){
int x1,y1,i;
int degree=3.2+(k-3)*1.75;
int D=1.732*sqrt(k)*SIDE;
int p=f/k;
for(i=1;i<p;i++){
x1=X+D*cos((degree*PI)/180);
y1=Y+D*sin((degree*PI)/180);
draw_hexagon(x1,y1);
recur_draw(x1,y1,k);
degree=degree+60;
}
}
wah kya baat hai re ladke...
ReplyDeleteI am very much pleased with the contents you have mentioned. I wanted to thank you for this great article. I enjoyed every little bit part of it and I will be waiting for the new updates. cell phone detection
ReplyDeleteAntalya
ReplyDeleteAntep
Burdur
Sakarya
istanbul
A30T
Denizli
ReplyDeleteKonya
Denizli
ısparta
Bayburt
AL55V
https://titandijital.com.tr/
ReplyDeletenevşehir parça eşya taşıma
bolu parça eşya taşıma
batman parça eşya taşıma
bayburt parça eşya taşıma
GMW
antalya evden eve nakliyat
ReplyDeleteankara evden eve nakliyat
bursa evden eve nakliyat
yalova evden eve nakliyat
gümüşhane evden eve nakliyat
FJPF
85146
ReplyDeleteGümüşhane Lojistik
Çerkezköy Sineklik
Çerkezköy Motor Ustası
Ağrı Şehirler Arası Nakliyat
Diyarbakır Lojistik
Denizli Evden Eve Nakliyat
Denizli Lojistik
Erzincan Evden Eve Nakliyat
Siirt Parça Eşya Taşıma
D81D9
ReplyDeleteBartın Şehir İçi Nakliyat
Diyarbakır Lojistik
Ünye Televizyon Tamircisi
Çerkezköy Çelik Kapı
Kocaeli Lojistik
Ünye Oto Elektrik
Ünye Kurtarıcı
Çankaya Parke Ustası
Bingöl Lojistik
E4807
ReplyDeletecanlı sohbet ücretsiz
batman bedava sohbet chat odaları
bayburt nanytoo sohbet
diyarbakır en iyi rastgele görüntülü sohbet
ardahan nanytoo sohbet
urfa sesli sohbet mobil
artvin telefonda sohbet
en iyi ücretsiz sohbet siteleri
canlı sohbet uygulamaları
ECCCB
ReplyDeleteMefa Coin Hangi Borsada
Binance Sahibi Kim
Kripto Para Nasıl Oynanır
Görüntülü Sohbet
Snapchat Takipçi Satın Al
Youtube Abone Satın Al
Kripto Para Kazanma
Loop Network Coin Hangi Borsada
Binance Borsası Güvenilir mi