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.
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
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
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
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;
}