/*	HELLO.C -- Hello, world */

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
#include <math.h>

main( int argc, char *argv[] )
{
double H,L,R,O;

if (argc!=3)  {
	printf("\nError \aError Error\a ERROR!!! invalid parameters\n");
	printf("\n\t==============================================================\n");
	printf("\t|| calcarc Height Length            Copyright HR Frazer 1996||\n");
	printf("\t|| e.g. calcarc 60 1310                                     ||\n");
	printf("\t|| gives the Radius of circle to produce this  ( =3605.208 )||\n");
	printf("\t==============================================================");
		   }
else	{
    printf("\n\t=====================================================");
    printf("\n\t|| CalcArc               Copyright HR Frazer 1996  ||");
    printf("\n\t=====================================================");

H=atoi(argv[1]);
L=atoi(argv[2]);
O=atan2(2*H,L);
/*printf("\n\t\tTheta = %3.3f radians",O);*/
R=L/(sin(O)*cos(O)*4);
printf("\n\t\tArc of Height %3.3f and Length %3.3f \n\t\t requires a Radius of %3.3f",H,L,R);
printf("\n\t\tPeaking at half length ( = %3.3f )\n",L/2);
	}
}



