Translation means repositioning of an object from place to another in a straight path by adding a translation factor or distance tx and ty. Together (tx,ty) are named as translation vector.
Suppose, there is a point on the coordinate (x,y), in order to move this point to a new position, we have to add something which can be considered as translation vector (tx,ty). The resultant point we would get is (x1,y1).
A = (x,y) , Point that need to be translated
V= (tx,ty) , This tells how much we have to move that point X
B = (x1,y1) , The new point after translation
x1 = x+ tx
C Program to show the working of translation
/* translation */
int x_initial,y_initial,x_final,y_final, x_vector,y_vector;
printf("\n Please enter an initial coordinate of the line = ");
scanf("%d %d", &x_initial,&y_initial);
printf("\n Now, \n enter final coordinate of the line = ");
printf("\n\t\t********** line before & after translation ***********");
printf("\nFirst enter the translation vector = ");
You must be logged in to take the quiz.