The question is to write a function that returns a bounding rectangle for a set of points in a two dimensional plane. SIZE is two. I know the points will come in this format {double, double} and I know how to create the bounding rectangle. I can't seem to grab the points though. I tried iterating like this.
Rectangle2D getRectangle(const double points[][SIZE], int s) {
for (int i = 0; i < s; i++) {
for (int j = 0; j < SIZE; j++) {
cout << points[s][SIZE] << endl;
}
}
// will put these points in after i figure out the iteration.
Rectangle2D rekt(x, y, width, height);
return rekt;
}
cout << points[s][SIZE] << endl;should becout << points[i][j] << endl;(observe i & j), if you want to print matrix.