line drawing and manipulation software

im a student at the University of Birmingham studying mechanical engineering. i have a programming coursework that i can't get to compile properly, im using salford plato ide. when i try to use the functions i get error messages. any help would be much appreciated.

#include <windows.h>
#include <dbos\graphics.h>
#include <iostream.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

void graphics_win (int wid,int ht, int xtopleft, int ytopleft);
double original_matrix[2][3];
double transformed_matrix[2][3];
double transformation_matrix[3][3];
int hand;

int draw();

int matrix();

int coordinates();

int scale();
double xscale=0.0;
double yscale=0.0;
double zscale=0.0;

int rotate();
double angle=0.0;
double rad;
int x_rotation();
int y_rotation();
int z_rotation();

int evaluate_point();
double x_evaluate;
double y_evaluate;
double z_evaluate;
int evaluate_point_result();

int show_points();


int main()
{

original_matrix[0][0]=0;
original_matrix[0][1]=0;
original_matrix[0][2]=0;
original_matrix[1][0]=0;
original_matrix[1][1]=0;
original_matrix[1][2]=0;

transformed_matrix[0][0]=0;
transformed_matrix[0][1]=0;
transformed_matrix[0][2]=0;
transformed_matrix[1][0]=0;
transformed_matrix[1][1]=0;
transformed_matrix[1][2]=0;

transformation_matrix[0][0]=0;
transformation_matrix[0][1]=0;
transformation_matrix[0][2]=0;
transformation_matrix[1][0]=0;
transformation_matrix[1][1]=0;
transformation_matrix[1][2]=0;
transformation_matrix[2][0]=0;
transformation_matrix[2][1]=0;
transformation_matrix[2][2]=0;

winio("%ca[Line]&");
winio("%ww\n&");

graphics_win(500,500,10,10); //opens graphics window
}


void graphics_win (int wid,int ht, int xtopleft, int ytopleft) //graphics window
{
winio("%gr[black]&",wid,ht);
winio("%sp&", xtopleft, ytopleft);
winio("\n%^bt[Coordinates]&",coordinates); //opens input coordinates window
winio("\n%^bt[Scale]&",scale); //opens scale window
winio("\n%^bt[Rotate]&",rotate); //opens rotate window
winio("\n%^bt[Evaluate Point]&", evaluate_point); //opens evaluate_point
winio("\n%^bt[Show Points]&", show_points);
//winio("\n%^bt[Clear Screen]&",clear_screen); //clears screen
winio("\n%bt[Quit]&"); //quit button
winio("%lw", &hand);
}


int draw() //draw line function
{
matrix();

draw_line(original_matrix[0][0],original_matrix[0][1],original_matrix[1][0],original_matrix[1][1],10); //draws original line
draw_line(transformed_matrix[0][0],transformed_matrix[0][1],transformed_matrix[1][0],transformed_matrix[1][1],100); //draws new line

return 1;
}


int matrix()
{
int i;
int j;

for (i=0;i<2;i++)
{
for (j=0;j<3;j++)
{
transformed_matrix [i][j] = original_matrix[i][0]*transformation_matrix[0][j]+original_matrix[i][1]*transformation_matrix[1][j]+original_matrix[i][2]*transformation_matrix[2][j];
}
}
return 1;
}


int coordinates() //coordinates function
{
winio("%ca[Coordinates]\n\n&");

winio("Please enter the first point\n&");
winio("Enter x value %10rf\n&", &original_matrix[0][0]);
winio("Enter y value %10rf\n&", &original_matrix[0][1]);
winio("Enter z value %10rf\n&", &original_matrix[0][2]);
// user input of first point on line

winio("Please enter the second point\n&");
winio("Enter x value %10rf\n&", &original_matrix[1][0]);
winio("Enter y value %10rf\n&", &original_matrix[1][1]);
winio("Enter z value %10rf\n&", &original_matrix[1][2]);
// user input of second point on line

winio("\n%^bt[Draw]&",draw); //draws line
winio ("%bt[Close]"); //closes coordinates window
return 1;
}


int scale() //scale function
{
winio("%ca[Scale]\n\n&");
winio("Enter x value scale factor %10rf\n&",&xscale);
winio("Enter y value scale factor %10rf\n&",&yscale);
winio("Enter z value scale factor %10rf\n&",&zscale);
winio("\n%^bt[Draw]&",draw); //draws line
winio("%bt[Close]"); //closes coordinates window

transformation_matrix[0][0]=xscale;
transformation_matrix[0][1]=0;
transformation_matrix[0][2]=0;
transformation_matrix[1][0]=0;
transformation_matrix[1][1]=yscale;
transformation_matrix[1][2]=0;
transformation_matrix[2][0]=0;
transformation_matrix[2][1]=0;
transformation_matrix[2][2]=zscale;

return 1;
}


int rotate() //rotate function
{
winio("%ca[Rotate]\n\n&");
winio("Enter angle of rotation %10rf\n&", &angle);
winio("\n%^bt[x-axis]&",x_rotation); //rotates about x-axis
winio("\n%^bt[y-axis]&",y_rotation); //rotates about y-axis
winio("\n%^bt[z-axis]&",z_rotation); //rotates about z-axis
winio("\n%^bt[Draw]&",draw); //draws line
winio("%bt[Close]&"); //closes coordinates window

double d=0.0;
double e=0.0;
double PI=3.141592653589793238462643383279;
d=(angle)/180;
e=d*PI;
rad=e;

return 1;
}

int x_rotation()
{
transformation_matrix[0][0]=1;
transformation_matrix[0][1]=0;
transformation_matrix[0][2]=0;
transformation_matrix[1][0]=0;
transformation_matrix[1][1]=cos(rad);
transformation_matrix[1][2]=sin(rad);
transformation_matrix[2][0]=0;
transformation_matrix[2][1]=-sin(rad);
transformation_matrix[2][2]=cos(rad);
draw();
return 1;
}

int y_rotation()
{
transformation_matrix[0][0]=cos(rad);
transformation_matrix[0][1]=0;
transformation_matrix[0][2]=-sin(rad);
transformation_matrix[1][0]=0;
transformation_matrix[1][1]=1;
transformation_matrix[1][2]=0;
transformation_matrix[2][0]=sin(rad);
transformation_matrix[2][1]=0;
transformation_matrix[2][2]=cos(rad);
draw();
return 1;
}

int z_rotation()
{
transformation_matrix[0][0]=cos(rad);
transformation_matrix[0][1]=sin(rad);
transformation_matrix[0][2]=0;
transformation_matrix[1][0]=-sin(rad);
transformation_matrix[1][1]=cos(rad);
transformation_matrix[1][2]=0;
transformation_matrix[2][0]=0;
transformation_matrix[2][1]=0;
transformation_matrix[2][2]=1;
draw();
return 1;
}


int evaluate_point()
{
double p=0.0;

winio("%ca[Evaluate Point]\n\n&");
winio("Enter value of P %10rf\n&", &p);
winio("\n%^bt[Evaluate]",evaluate_point_result);

//p>=1;
//winio("%ca[Error]\n\n&");
//winio("The value of P must be between 0 and 1&");


x_evaluate=original_matrix[1][0]*p;
y_evaluate=original_matrix[1][1]*p;
z_evaluate=original_matrix[1][2]*p;
return 1;
}

int evaluate_point_result()
{
winio("%ca[Evaluate Point]\n\n&");
winio("x value is %10wf\n&",x_evaluate);
winio("y value is %10wf\n&",y_evaluate);
winio("z value is %10wf\n&",z_evaluate);
return 1;
}

int show_points()
{
winio("%ca[Show]\n\n&");

winio("Original Line x1 is %wf\n&", original_matrix[0][0]);
winio("Original Line y1 is %wf\n&", original_matrix[0][1]);
winio("Original Line z1 is %wf\n&", original_matrix[0][2]);
winio("Original Line x2 is %wf\n&", original_matrix[1][0]);
winio("Original Line y2 is %wf\n&", original_matrix[1][1]);
winio("Original Line z2 is %wf\n&", original_matrix[1][2]);

winio("Transformed Line x1 is %wf\n&", transformed_matrix[0][0]);
winio("Transformed Line y1 is %wf\n&", transformed_matrix[0][1]);
winio("Transformed Line z1 is %wf\n&", transformed_matrix[0][2]);
winio("Transformed Line x2 is %wf\n&", transformed_matrix[1][0]);
winio("Transformed Line y2 is %wf\n&", transformed_matrix[1][1]);
winio("Transformed Line z2 is %wf\n&", transformed_matrix[1][2]);
return 1;
}
Topic archived. No new replies allowed.