Page 1 of 1

Exercise Objectives ✓ 2D Array / image application Problem Description Write a C function called RotateLine90. The funct

Posted: Sun May 15, 2022 7:57 am
by answerhappygod
Exercise Objectives 2d Array Image Application Problem Description Write A C Function Called Rotateline90 The Funct 1
Exercise Objectives 2d Array Image Application Problem Description Write A C Function Called Rotateline90 The Funct 1 (70.21 KiB) Viewed 54 times
Exercise Objectives ✓ 2D Array / image application Problem Description Write a C function called RotateLine90. The function receives a (2D) two-dimensional array of type integer of size 5 by 5, also the function receives coordinates of line points. The function should have the following signature: void RoateLine 99.jot A[][5], int pointix, int pointly, int point2x, int point2y) The integer array represents an image that has two colors (black and white). Each array cell of value 1 represents black color and each array cell of value represents white color. The image can have only horizontal vertical lines. Function is supposed to rotate the given line by 90 degrees counter clockwise. For example, below is an image of 5 by 5 with two horizontal lines, the left side shows the image and the right side shows the equivalent matrix of it: Page 3 of 4 01234 HO WHO lo 0 0 0 0 10 0 10 1 0 0 1 10 o 1 0 1 0 0 1 0 0 0 1 Calling the function RoateLine 90(A,2,2,2,4) will result in rotating the line from (2.2) thru (2,4) by 90 degrees, so it will become from (2,2) thru (0,2). The final shape should be 01234 0 o 0 0 0 0 10 0 1 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0