This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 4]); This function should take in two arrays, each of length 4, which represent two rectangles. In both arrays, the first element is the x coordinate of the bottom left point of the rectangle, the second element is the y coordinate of the bottom left point of the rectangle, the third element is the width of the rectangle, and the fourth element is the height of the rectangle. This function outputs the area, if any, which is covered by both rectangles, as a floating point number. If the rectangles do not overlap, the area should be zero. float polygon_area(float arrX, float arrY, int n); This function computes the area of a polygon with n vertices. Assume that the polygon does not intersect itself. The coordinates of the polygon are passed to the function via two arrays of length n. The first array contains the x coordinates, and the second array contains the y coordinates of the points. The area can be computed by finding the determinant of a 2xn matrix. For details on how to compute the area, please see the following link: http://mathworld.wolfram.com/PolygonArea.html Task 4 – Sorting void bubbleSort(int arr, int n); This function takes in an array of length n, and then sorts it in ascending order. After this function is called, the array rray of length n. The function should compute the result mat x vec, and then store the result i...
View
Full
Document
This homework help was uploaded on 03/02/2014 for the course CS 200 taught by Professor Fareedzaffar during the Winter '11 term at Lahore University of Management Sciences.
 Winter '11
 FareedZaffar

Click to edit the document details