**************************Text edits for available programs************************************* Time in SR (dos) #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include void setshit(double x[MAX]); void printarray(double x[MAX]); int main(void) { int done,i,val; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val); if(val<=2 && val>=1) { if(val==1) { setshit(a); printarray(a); } if(val==2) done=TRUE; } } return 0; } void printarray(double x[MAX]) { double t; t=x[0]*(sqrt(1-(x[1]*x[1]))); printf("Time elapsed on your watch %lfminutes\n\n",x[0]); printf("Speed of an Observer %lfc (c= speed of light)\n Relative to You\n\n",x[1]); printf("Time elapsed on the Observers watch %lfminutes\n\n",t); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); } void setshit(double x[MAX]) { double j,n; printf("Enter the elapsed time in your frame (in minutes):\n>"); scanf("%lf", &n); x[0]=n; n=2; while(n>=1) { printf("Enter the Speed of the Observer passing you Relative to The Speed of Light\nfor example: .5 =half the speed of light (must be less than 1)\n>"); scanf("%lf",&n); } x[1]=n; printf("\n\n\n"); } Time in SR #include #include #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include #include void settime(double x[MAX],CS_Window w); void setspeed(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w); int main(void) { int done,i,val2; double a[MAX]; CS_Window wind; done=FALSE; wind=cs_make_window("white",45,30,700,500); for(i=0; i=1) { if(val2==1) settime(a,wind); if(val2==2) setspeed(a,wind); if(val2==3) done=TRUE; wind=cs_make_window("white",45,30,700,500); printarray(a,wind); } } } return 0; } void printarray(double x[MAX], CS_Window w) { double xc,yc,s,t; int i,f; f=205; s=500/(MAX+1); yc=75; cs_set_color("black"); cs_printf(w,f,yc,"Time Elapsed \non Your Watch"); yc=yc+s; cs_printf(w,f,yc,"Speed of the \nOther Observer\n Relative to You"); yc=yc+s; cs_printf(w,f,yc,"Time Elapsed \non Observers Watch"); yc=75; xc=450; for(i=0; i1) cs_scanf(" IT MUST BE LESS THAN OR EQUAL TO 1!!\n speeds higher than that of light are impossible\nEnter the Speed of the Other Observer\n Relative to The Speed of Light\nfor example: .5 =half the speed of light ","%lf", &n); x[1]=n; cs_remove_window(w); } Length in SR (dos) #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include void setshit(double x[MAX]); void printarray(double x[MAX]); int main(void) { int done,i,val; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val); if(val<=2 && val>=1) { if(val==1) { setshit(a); printarray(a); } if(val==2) done=TRUE; } } return 0; } void printarray(double x[MAX]) { double t; t=x[0]*(sqrt(1-(x[1]*x[1]))); printf("Actual Length %lfmeters\n\n",x[0]); printf("Speed of the Object %lfc (c= speed of light)\n Relative to You\n\n",x[1]); printf("Length Observed by You %lfmeters\n\n",t); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); } void setshit(double x[MAX]) { double j,n; printf("Enter the Length of the Object in a Rest Frame (in meters):\n>"); scanf("%lf", &n); x[0]=n; n=2; while(n>=1) { printf("Enter the Speed of the Object Relative to The Speed of Light\nfor example: .5 =half the speed of light (must be less than 1)\n>"); scanf("%lf",&n); } x[1]=n; printf("\n\n\n"); } Length in SR #include #include #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include #include void setlength(double x[MAX],CS_Window w); void setspeed(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w); int main(void) { int done,i,val2; double a[MAX]; CS_Window wind; done=FALSE; wind=cs_make_window("black",45,30,700,500); for(i=0; i=1) if(val2<=2 && val2>=1) { if(val2==1) setlength(a,wind); if(val2==2) setspeed(a,wind); wind=cs_make_window("black",45,30,700,500); printarray(a,wind); } if(val2==3) done=TRUE; } } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w) { double xc,yc,s,t; int i,f; f=205; s=500/(MAX+1); yc=75; cs_set_color("white"); cs_printf(w,f,yc,"Actual Length \nof an Object"); yc=yc+s; cs_printf(w,f,yc,"Speed of the \nObject Relative\n to You"); yc=yc+s; cs_printf(w,f,yc,"Contracted Length \nof the Object"); yc=75; xc=450; for(i=0; i1) cs_scanf(" IT MUST BE LESS THAN OR EQUAL TO 1!!\n speeds higher than that of light are impossible\nEnter the Speed of the Other Observer\n Relative to The Speed of Light\nfor example: .5 =half the speed of light ","%lf", &n); x[1]=n; cs_remove_window(w); } Mass of a Black Hole (dos) #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include #define G 1.327E11 #define c 2.998E5 void setmass(double x[MAX]); void setradius(double x[MAX]); void printarray(double x[MAX]); void eval(double x[MAX], int val); int main(void) { int done,i,val2; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val2); if(val2<=2 && val2>=1) { if(val2==1) { setmass(a); eval(a,val2); } if(val2==2) { setradius(a); eval(a,val2); } printarray(a); } if(val2==3) done=TRUE; } return 0; } void printarray(double x[MAX]) { printf("The Mass of the Black Hole %lf solar masses\n\n\n", x[0]); printf("The Radius of the Event Horizon %lf kilometers\n", x[1]); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); } void setmass(double x[MAX]) { double n; printf("Enter the Mass of the Black Hole Compared to the mass of the Sun \n ( ex. 20 = 20Solar Masses )\n>"); scanf("%lf", &n); x[0]=n; } void setradius(double x[MAX]) { double n; printf("Enter the Radius of the Black Hole measured by the circumference \n ( in kilometers ) \n>"); scanf("%lf", &n); x[1]=n; } void eval(double x[MAX], int val) { if(val==1) x[1]=(2*G*x[0])/(c*c); if(val==2) x[0]=(x[1]*c*c)/(2*G); } Mass of a Black Hole #include #include #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include #include #define G 1.327E11 #define c 2.998E5 void setmass(double x[MAX]); void setradius(double x[MAX]); void printarray(double x[MAX],CS_Window w); void eval(double x[MAX], int val,CS_Window w); int main(void) { int done,i,val2; double a[MAX]; CS_Window wind; done=FALSE; wind=cs_make_window("orange",75,50,500,300); for(i=0; i=1) { if(val2==1) { setmass(a); eval(a,val2,wind); } if(val2==2) { setradius(a); eval(a,val2,wind); } wind=cs_make_window("orange",75,50,500,300); printarray(a,wind); } if(val2==3) done=TRUE; } } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w) { double yc,s; int i,f; f=25; s=246; yc=175; cs_set_color("blue"); cs_printf(w,f,yc,"Mass of the Black Hole"); f=f+s; cs_printf(w,f,yc,"Radius of the Black Hole"); s=256; yc=220; f=30; for(i=0; i #include void setshit(double x[MAX]); void printarray(double x[MAX]); int main(void) { int done,i,val; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val); if(val<=2 && val>=1) { if(val==1) { setshit(a); printarray(a); } if(val==2) done=TRUE; } } return 0; } void printarray(double x[MAX]) { double t; if(x[2]==0) t=0; if(x[2]>=x[1] && x[2]!=0) t=x[0]*(sqrt(1-(x[1]/x[2]))); if(x[2]"); scanf("%lf", &n); x[0]=n; if(x[0]!=0){ printf("Enter the Radius of the Black Hole's event horizon \n ( in kilometers ) \n>"); scanf("%lf",&r); x[1]=r; printf("Enter the distance from the singularity the other observer is \n ( in kilometers ) \n>"); scanf("%lf",&d); x[2]=d; } printf("\n\n\n"); } Time near a Black Hole #include #include #define TRUE 0 #define FALSE 1 #define MAX 3 #include #include #include void settime(double x[MAX],CS_Window w); void setsize(double x[MAX],CS_Window w); void setdistance(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w, int val); int main(void) { int done,i,val2; double a[MAX]; CS_Window wind; val2=0; done=FALSE; wind=cs_make_window("orange",45,30,700,500); for(i=0; i=1) { if(val2==1) settime(a,wind); if(val2==2) setsize(a,wind); if(val2==3) setdistance(a,wind); wind=cs_make_window("orange",45,30,700,500); printarray(a,wind,val2); } if(val2==4) done=TRUE; } } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w, int val) { double xc,yc,s,t; int f; f=205; s=500/(MAX+1); yc=75; cs_set_color("black"); cs_printf(w,f,yc,"Time Elapsed \non Your Watch"); yc=yc+s; cs_printf(w,f,yc,"Radius of the \nBlack Hole"); yc=yc+s; cs_printf(w,f,yc,"Distance of the \nOther Observer\nfrom the Singularity"); yc=yc+s; cs_printf(w,f,yc,"Time Elapsed \non Observers Watch"); yc=75; xc=450; cs_printf(w,xc,yc,"%lf minutes", x[0]); yc=yc+s; cs_printf(w,xc,yc,"%lf kilometers", x[1]); yc=yc+s; cs_printf(w,xc,yc,"%lf kilometers", x[2]); yc=yc+s; if(x[2]==0) t=0; if(x[2]>=x[1] && x[2]!=0) t=x[0]*(sqrt(1-(x[1]/x[2]))); if(x[2] #include void setshit(double x[MAX]); void printarray(double x[MAX]); int main(void) { int done,i,val; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val); if(val<=2 && val>=1) { if(val==1) { setshit(a); printarray(a); } if(val==2) done=TRUE; } } return 0; } void printarray(double x[MAX]) { double t; if(x[2]==0) t=0; if(x[2]>=x[1] && x[2]!=0) t=x[0]*(sqrt(1-(x[1]/x[2]))); if(x[2]"); scanf("%lf", &n); x[0]=n; if(x[0]!=0){ printf("Enter the Radius of the Black Hole's event horizon \n ( in kilometers ) \n>"); scanf("%lf",&r); x[1]=r; printf("Enter the distance from the singularity \n ( in kilometers ) \n>"); scanf("%lf",&d); x[2]=d; } printf("\n\n\n"); } Length near a Black Hole #include #include #define TRUE 0 #define FALSE 1 #define MAX 3 #include #include #include void setlength(double x[MAX],CS_Window w); void setsize(double x[MAX],CS_Window w); void setdistance(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w, int val); int main(void) { int done,i,val2; double a[MAX]; CS_Window wind; val2=0; done=FALSE; wind=cs_make_window("yellow",45,30,700,500); for(i=0; i=1) { if(val2==1) setlength(a,wind); if(val2==2) setsize(a,wind); if(val2==3) setdistance(a,wind); wind=cs_make_window("yellow",45,30,700,500); printarray(a,wind,val2); } if(val2==4) done=TRUE; } } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w, int val) { double xc,yc,s,t; int f; f=205; s=500/(MAX+1); yc=75; cs_set_color("purple"); cs_printf(w,f,yc,"Length measured by\ncircumference"); yc=yc+s; cs_printf(w,f,yc,"Radius of the \nBlack Hole"); yc=yc+s; cs_printf(w,f,yc,"Distance from \nthe Singularity"); yc=yc+s; cs_printf(w,f,yc,"Length measured\ndirectly"); yc=75; xc=450; cs_printf(w,xc,yc,"%lf meters", x[0]); yc=yc+s; cs_printf(w,xc,yc,"%lf kilometers", x[1]); yc=yc+s; cs_printf(w,xc,yc,"%lf kilometers", x[2]); yc=yc+s; if(x[2]==0) t=0; if(x[2]>x[1] && x[2]!=0) t=x[0]/(sqrt(1-(x[1]/x[2]))); if(x[2] # define false 0 # define true 1 #include void setcell(double x[MAX]); void printarray(double x[MAX]); int main(void) { int i; double a[MAX],val,n, total; int done,c; for(i=0; i"); scanf("%lf", &val); if( val==2 || val==1) { if(val==1) setcell(a); if(val==2) done=true; printarray(a); } else printf("invalid choice\n\n"); } return 0; } void printarray(double x[MAX]) { double vn,vf; vn=0; vf=0; if(x[0]<=x[1]) { printf("\n\n\n\n\n\n"); printf("Radius of the black hole %lf kilometers\n measured by the circumference\n\n", x[0]); printf("Distance from the Black Hole %lf kilometers\n an object is when\n measuring\n\n",x[1]); if(x[0]!=0 && x[1]!=0 && x[0]<=x[1]) { vn=(sqrt(x[0]/x[1])); vf=(sqrt(x[0]/x[1]))*(1-(x[0]/x[1])); } printf("Velocity observed near %lfc (c = speed of light)\n the Black Hole\n\n",vn); printf("Velocity observed far %lfc (c = speed of light)\n from the Black Hole\n\n",vf); } else printf("\n\n\n\n\n\n\n\n\n\n\ THE OBJECT IS INSIDE THE EVENT HORIZON\n IT CAN'T BE SEEN \n\n\n"); printf("\n\n\n\n\n\n\n"); } void setcell(double x[MAX]) { double h,d; printf("Enter the radius of the event horizon(in kilometers)\n>"); scanf("%lf", &h); printf("Enter the distance from the singularity the object is\n when the velocity is measured\n>"); scanf("%lf", &d); x[0]=h; x[1]=d; } Velocity near a Black Hole #define TRUE 0 #define FALSE 1 #define MAX 2 #include #include #include void single(void); void event (void); void setev(double x[MAX],CS_Window w); void setdistance(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w, int val); int main(void) { int done,i,val; double a[MAX]; CS_Window wind; val=0; done=FALSE; wind=cs_make_window("black",45,30,700,500); for(i=0; i=1) {if(val<=2 && val>=1) {if(val==1) setev(a,wind); if(val==2) setdistance(a,wind); wind=cs_make_window("black",45,30,700,500); printarray(a,wind,val); }} if(val==3) done=TRUE; } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w, int val) { double xc,yc,s,vf,vn; int i,f,p; p=1; f=5; s=500/(MAX+2); yc=75; cs_set_color("red"); cs_printf(w,f,yc,"Radius of the Event Horizon\n measured by circumference"); yc=yc+s; cs_printf(w,f,yc,"Distance from the\n singularity"); yc=yc+s; cs_printf(w,f,yc,"Velocity measured from\n far away\n relative to the speed\n of light"); yc=yc+s; cs_printf(w,f,yc,"Velocity mesured near\n the Black Hole\n relative to the speed\n of light"); yc=75; xc=450; for(i=0; ix[1] && x[1]!=0 && val!=3) event(); if(x[1]==0 && val==2) single(); } void setdistance(double x[MAX],CS_Window w) { double n; cs_scanf(" Enter the distance from the singularity \n an object being pulled in radialy is, \n at the time you measure it's velocity \n(in kilometers) \n ","%lf", &n); x[1]=n; cs_remove_window(w); } void setev(double x[MAX],CS_Window w) { double n; cs_scanf(" Enter the radius of the event horizon\n of the black hole \n(in kilometers) ","%lf", &n); x[0]=n; cs_remove_window(w); } void event(void) { CS_Window q; q=cs_make_window("white",450,335,225,125); cs_set_color("green"); cs_printf(q,20,50,"IT'S IN THE BLACK HOLE!\n Nobody can see it"); cs_printf(q,20,125," >>click to remove<<"); while (cs_mouse_btn(q) == 0) ; cs_remove_window(q); } void single(void) { CS_Window q; q=cs_make_window("green",450,335,235,125); cs_set_color("white"); cs_printf(q,20,50,"IT'S AT THE SINGULARITY!\n Nobody can see it"); cs_printf(q,20,125," >>click to remove<<"); while (cs_mouse_btn(q) == 0) ; cs_remove_window(q); } Gravitational Redshift (dos) #define TRUE 0 #define FALSE 1 #define MAX 3 #include #include void setshit(double x[MAX]); void printarray(double x[MAX]); int main(void) { int done,i,val; double a[MAX]; done=FALSE; for(i=0; i"); scanf("%d", &val); if(val<=2 && val>=1) { if(val==1) { setshit(a); printarray(a); } if(val==2) done=TRUE; }} return 0; } void printarray(double x[MAX]) { char i[13]; char f[13]; double t; if(x[2]!=0 && x[1]!=x[2] && x[1]<=x[2]) t=x[0]/(sqrt(1-(x[1]/x[2]))); else t=0; if(x[1]==x[2] && x[2]==0) t=x[0]; printf("Original wavelength of light emitted %lf nanometers\n\n",x[0]); printf("Radius of the Event Horizon of the %lf kilometers\n Black Hole \n\n",x[1]); printf("Distance from the Singularity the light %lf kilometers\n is emitted from\n\n",x[2]); if(x[1]>x[2]) printf("The light was emmitted from inside the Black Hole and could not escape\n\n "); else {if(x[1]==x[2] && x[2]!=0 && x[0]!=0) { t=0; printf("Wavelength received far from the INFINITE\n Black Hole \n\n");} else printf("Wavelength received far from the %lf nanometers\n Black Hole \n\n",t); } printf("\n\n\n\n"); if(t!=0 && x[0]!=t){ printf(">>The wave shifted from "); if(x[0]<400) printf("an Ultra Violet wave to "); if(x[0]>700) printf("an Infra Red wave to "); if(x[0]>=400 && x[0]<425) printf("Violet light to "); if(x[0]>=425 && x[0]<475) printf("Blue light to "); if(x[0]>=475 && x[0]<525) printf("Green light to "); if(x[0]>=525 && x[0]<575) printf("Yellow light to "); if(x[0]>=575 && x[0]<625) printf("Orange light to "); if(x[0]>=625 && x[0]<700) printf("Red light to "); if(t<400 && x[0]<400 ) printf("a larger Ultra Violet wave<<"); else{ if(t>700 && x[0]>700) printf("a larger Infra Red wave<<"); else{ if(t<400) printf("an Ultra Violet wave<<"); if(t>700) printf("an Infra Red wave<<"); if(t>=400 && t<425) printf("Violet light <<<"); if(t>=425 && t<475) printf("Blue light <<<"); if(t>=475 && t<525) printf("Green light <<<"); if(t>=525 && t<575) printf("Yellow light <<<"); if(t>=575 && t<625) printf("Orange light <<<"); if(t>=625 && t<700) printf("Red light <<<"); } } } if(x[1]==x[2] && x[2]==0 && x[0]!=0) printf(">>>>>>>>>>>>>> NO SHIFT <<<<<<<<<<<<<<<<<<"); printf("\n\n\n\n\n"); } void setshit(double x[MAX]) { double j,n; printf("Enter the original wavelength of the light in nanometers:\n (visible light ranges from 400 to 700 nanometers)\n>"); scanf("%lf", &n); x[0]=n; printf("Enter radius of the Black hole in kilometers:\n>"); scanf("%lf", &n); x[1]=n; if(x[1]!=0){ printf("Enter distance from the singularity the light wave originated at:\n (in kilometers)\n>"); scanf("%lf", &n); x[2]=n;} else x[2]=0; printf("\n"); } Gravitational Redshift #define TRUE 0 #define FALSE 1 #define MAX 3 #include #include #include void event(void); void single(void); void setsize (double x[MAX],CS_Window w); void setow(double x[MAX],CS_Window w); void setdistance(double x[MAX],CS_Window w); void printarray(double x[MAX],CS_Window w, int val); int main(void) { int done,i,val; double a[MAX]; CS_Window wind; val=0; done=FALSE; wind=cs_make_window("white",5,30,775,500); for(i=0; i=1) {if(val<=3 && val>=1) {if(val==3) setow(a,wind); if(val==1) setsize(a,wind); if(val==2) setdistance(a,wind); wind=cs_make_window("white",5,30,775,500); printarray(a,wind,val); }} if(val==4) done=TRUE; } cs_remove_window(wind); return 0; } void printarray(double x[MAX], CS_Window w, int val) { double xc,yc,s,wr,lc; int i,f,d,nm; wr=0; f=250; s=425/(MAX+2); yc=75; cs_set_color("black"); cs_printf(w,f,yc,"Radius of the Event Horizon\n measured by circumference"); yc=yc+s; cs_printf(w,f,yc,"Distance from the singularity\n light is emmitted"); yc=yc+s; cs_printf(w,f,yc,"Original wavelength of the \n emmitted light"); yc=yc+s; cs_printf(w,f,yc,"Shifted wavelegth received \n far from the Black Hole"); yc=65; xc=550; for(i=0; i<2; i++) { cs_printf(w,xc,yc,"%lf kilometers",x[i]); yc=yc+s; } cs_printf(w,xc,yc,"%lf nanometers",x[2]); yc=yc+s; if(x[0]==x[1] && x[0]!=0 && x[2]!=0) cs_printf(w,xc,yc,"INFINITE"); if(x[2]==0) cs_printf(w,xc,yc,"%lf nanometers", wr); if(x[0]!=0 && x[1]!=0 && x[0]x[1] && x[1]!=0 && val!=4 && x[0]!=0) event(); if(x[1]==0 && val==2 && x[0]!=0) single(); cs_set_color("black"); cs_draw_line(w,75,45,75,345); lc=55; for(d=0; d<9; d++) {cs_draw_line(w,70,lc,80,lc); lc=lc+35;} lc=105; nm=400; for(d=0; d<7; d++) {cs_printf(w,17,lc-5,"%dnm",nm); lc=lc+35; nm=nm+50;} cs_printf(w,42,65,"-"); cs_printf(w,42,lc-5,"+"); cs_set_color("violet"); lc=110; cs_printf(w,85,lc-5,"Violet Light"); lc=lc+35; cs_set_color("blue"); cs_printf(w,85,lc-5,"Blue Light"); lc=lc+35; cs_set_color("green"); cs_printf(w,85,lc-5,"Green Light"); lc=lc+35; cs_set_color("yellow"); cs_printf(w,85,lc-5,"Yellow Light"); lc=lc+35; cs_set_color("orange"); cs_printf(w,85,lc-3,"Orange Light"); lc=lc+35; cs_set_color("red"); cs_printf(w,85,lc,"Red Light"); cs_set_color("black"); cs_printf(w,85,65,"Ultra Violet"); cs_printf(w,85,lc+40,"Infra Red"); } void setdistance(double x[MAX],CS_Window w) { double n; cs_scanf(" Enter the distance from the singularity \n the Light is emmitted from \n (in kilometers) \n ","%lf", &n); x[1]=n; cs_remove_window(w); } void setow(double x[MAX],CS_Window w) { double n; cs_scanf(" Enter the Wavelength of the Original light emmitted near\n the black hole \n(in nanometers) ","%lf", &n); x[2]=n; cs_remove_window(w); } void event(void) { CS_Window q; q=cs_make_window("black",200,175,325,225); cs_set_color("red"); cs_printf(q,70,100,"IT'S IN THE BLACK HOLE!\n Nothing can escape"); cs_printf(q,80,225," >>click to remove<<"); while (cs_mouse_btn(q) == 0) ; cs_remove_window(q); } void single(void) { CS_Window q; q=cs_make_window("red",200,175,335,225); cs_set_color("black"); cs_printf(q,70,100,"IT'S AT THE SINGULARITY!\n Nothing can escape"); cs_printf(q,80,225," >>click to remove<<"); while (cs_mouse_btn(q) == 0) ; cs_remove_window(q); } void setsize(double x[MAX],CS_Window w) { double n; cs_scanf(" Enter the Radius of the Black Hole's event horizon measured by circumference\n (in kilometers) ","%lf", &n); x[0]=n; cs_remove_window(w); } Time to singularity (dos) #define TRUE 0 #define FALSE 1 #include #include #define G 1.327E11 #define c 2.998E5 double setradius(void); void printarray(double r); int main(void) { int done,val2; double r; done=FALSE; r=0; printarray(r); while(done!=TRUE) { printf("choose an operation:\n 1 set the mass of the Black Hole\n 2 quit program\n>"); scanf("%d", &val2); if(val2==1) { r=setradius(); printarray(r); } if(val2==2) done=TRUE; } return 0; } void printarray(double r) { double t; t=(4*G*r)/(3*c*c*c); printf("\n\n\nMass of the Black Hole %lf solar masses\n\n\n\n", r); printf("After entering the Black Hole you have %lf seconds\n until you hit the Singularity.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", t); } double setradius() { double n; printf("Enter the Mass of the Black Hole relative to the mass of the Sun \n ( 20 = 20solar masses ) \n>"); scanf("%lf", &n); return n; } Time to singularity #include #include #define TRUE 0 #define FALSE 1 #include #include #include #define G 1.327E11 #define c 2.998E5 double setradius(CS_Window w); void printarray(double r,CS_Window w); int main(void) { int done,val2; double r; CS_Window wind; done=FALSE; wind=cs_make_window("green",75,50,450,300); r=0; printarray(r,wind); while(done!=TRUE) { cs_set_color("black"); cs_fill_circle(wind,225,60,40); cs_set_color("blue"); cs_draw_circle(wind,225,60,40); cs_set_color("white"); cs_printf(wind,199,84," click\n for\noptions"); while(cs_mouse_btn(wind)==0) ; cs_scanf("choose an operation:\n 1 set the mass of the Black Hole\n 2 quit program\n\n\n","%d",&val2); if(val2==1) {r=setradius(wind); wind=cs_make_window("green",75,60,450,300); printarray(r,wind);} if(val2==2) done=TRUE; } cs_remove_window(wind); return 0; } void printarray(double r, CS_Window w) { double t; int yc,xc; cs_set_color("white"); xc=70; yc=270; t=(4*G*r)/(3*c*c*c); cs_printf(w,xc,yc," After entering the Black Hole you have\n\n%lf seconds till you hit the singularity.",t); cs_set_color("black"); cs_printf(w,85,170,"Mass of the Black Hole (in Solar Masses)\n %lf ",r); } double setradius(CS_Window w) { double n; cs_scanf(" Enter the Mass of the Black Hole\n relative to the mass of the Sun \n ( 20 = 20solar masses ) \n\n ","%lf", &n); cs_remove_window(w); return n; }