/**
Microsoft C V6.0 Test code
*/

#define matcoeff    double
#define coords	    double
#define boolean int

typedef struct  point   {
    coords  x,y,z,w;
} POINT, *POINTPTR;

typedef struct  matrix  {
    matcoeff	a[4][4];
} MATRIX, *MATPTR;

extern	boolean IITCoPro(void);
extern	void	F4X4(POINTPTR, MATPTR, POINTPTR);

int main(int argc, char *argv[])
{
    MATRIX  m;
    POINT   p;

    if (!IITCoPro())
	{puts("\nIITCoPro NOT found ...."); return 1;}

    puts("\nIIT CoPro Found .....\n");

/* set up matrix coefficients */
    m.a[0][0] = (double)   -0.2341;
    m.a[0][1] = (double)    1.7653421;
    m.a[0][2] = (double)  197.2341;
    m.a[0][3] = (double)   -0.654321;
    m.a[1][0] = (double)   -1.110765;
    m.a[1][1] = (double)    3.4571;
    m.a[1][2] = (double)   -0.006543;
    m.a[1][3] = (double)   10.2416798;
    m.a[2][0] = (double)    5.43;
    m.a[2][1] = (double)    1.0;
    m.a[2][2] = (double)   26.342;
    m.a[2][3] = (double)  -19.5432;
    m.a[3][0] = (double)   21.654321;
    m.a[3][1] = (double)  123.9987;
    m.a[3][2] = (double)    1.111111;
    m.a[3][3] = (double) 7123.465123;

/* now vector coordinates */
    p.x = (double) -213.4256733;
    p.y = (double)    0.008976327;
    p.z = (double)   10.0;
    p.w = (double)   15.23011674;

/* Do 4x4 matrix multiplication */
    F4X4(&p, &m, &p);

    printf("\nNew Values are: %f %f %f %f\n", p.x, p.y, p.z, p.w);

    return 0;

}
