I think what he means is this:
He is given the start and end points of a line in three dimensional space:
Start = (2,3,0) End = (9,4,2)
I'm assuming this would be P1 and P2 in his previous program
Now he has to translate that line using the translation matrix:
(x,y,z)
So the start point and end point have moved coordinates.
Next his program has to handle a scaling of that line and a rotation of that line.
However, from the links given above, you will realise that scaling and rotating lines in three dimensional space is far from trivial.
Unless of course, he intends to scale and rotates the line in two-dimensional space. Which of course would be a darn sight easier.
If it's the former then its gonna be a pretty tough assignment!
You will probably be needing to multiply matrices... Here's some sample code of how it might be done.
Code:
/*================================================
A program which performs matrix
multiplication.
Notes
-----
Multiplication can only take place iff
the number of columns in matrix A is equal
to the number of rows in matrix B.
Or as I like to remember it:
C A R B
Columns in
A must equal
Rows in
B
================================================*/
#include <stdio.h>
#include <stdlib.h>
//Function declarations
void mmult(int,int,int[][100],int[][100]);
int main()
{
//Hard code matrix A
int m1[100][100] = {{1,5},
{2,7},
{3,4}};
//Hard code matrix B
int m2[100][100] = {{8,4,3,1},
{2,5,8,6}};
//call function
mmult(3,4,m1,m2);
//Where '3' is the maximum number of columns in either
//matrix A or B
//and '4' is the maximun number of rows in either
//matrix A or B
printf("\nPress any key to quit");
int quit;
scanf("%d", &quit);
return 0;
}
/*======================================================
Function to multiply matrix
=====================================================*/
void mmult (int rows, int cols, int m1[][100], int m2[][100])
{
int m3[100][100];//holds the result of A * B
for (int i=0; i<rows; i++)
{
for (int j=0; j<cols; j++)
{
int val = 0;
for (int k=0; k<cols; k++)
{
val = val + m1[i][k] * m2[k][j];
}
m3[i][j] = val;
}
}
//print matrix
for (int i=0; i<rows; i++)
{
for (int j=0; j<cols; j++)
{
printf("%d ",m3[i][j]);
}
printf("\n");
}
}