Unformatted text preview: a function, it is passed by “reference”. Which essentially means that if an array is modified inside a function, then its results will be visible to the function that called it as well. void cross(float result[3], float vec1[3], float vec2[3]); This function should take in as input three arrays of floating point numbers, with each array of length 3. This function should compute the cross product vec1 x vec2, and store it in the “result” array passed as the first argument. This function should not declare or allocate memory for the result array – this is the job of the function that calls the cross function. The cross function will only modify the contents of the result array. Task 3  Geometry This task will require you to implement some basic geometric functions. bool intersect(float l1[2][2], float l2[2][2]); This function takes in two two dimensional arrays, each of size 2x2. l1 contains the coordinates of line segment 1, and l2 contains the coordinates of line segment 2. In both matrices, the following scheme is followed: • The first row contains both x and y coordinates of the first endpoint. • The first column contains the x coordinates of both endpoints. The function should output true if the line segments intersect, and false otherwise. float area_overlap(float rect1[4], float rect2[...
View
Full Document
 Winter '11
 FareedZaffar
 Derivative, Array, Tuple

Click to edit the document details