Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Key points: 0.2747,-0.0407 0.2930,-0.3502 0.2509,-0.5394 0.1940,-0.6613 0.0828,-0.7390 -0.1972,-0.1785 -0.3611,-0.2505 -0.5128,-0.3271 -0.5788,-0.3423 -0.1744,-0.1047 -0.3375,-0.1832 -0.4705,-0.2038 -0.5197,-0.2352 -0.0669,-0.0326 -0.2741,-0.2601 -0.3911,-0.4155 -0.4484,-0.4903 0.0518, 0.0372 -0.0310,-0.3577 -0.0200,-0.6797 -0.0152,-0.8077 2.

image text in transcribed

image text in transcribed

Key points:

0.2747,-0.0407 0.2930,-0.3502 0.2509,-0.5394 0.1940,-0.6613 0.0828,-0.7390 -0.1972,-0.1785 -0.3611,-0.2505 -0.5128,-0.3271 -0.5788,-0.3423 -0.1744,-0.1047 -0.3375,-0.1832 -0.4705,-0.2038 -0.5197,-0.2352 -0.0669,-0.0326 -0.2741,-0.2601 -0.3911,-0.4155 -0.4484,-0.4903 0.0518, 0.0372 -0.0310,-0.3577 -0.0200,-0.6797 -0.0152,-0.8077

2. Create a program that reads a file of 2D coordinates and calculates the bounding box and center of the bounding box. The bounding box is defined as the minimum area that fully encompasses all the coordinates. The center of that bounding box is calculated by taking the mean of the bounding box coordinates: (12, 41+42). 2 Use file keypoints.txt for an example of what the input data will look like. If the input file cannot be opened, warn the user by printing "CANNOT OPEN FILE." to stdout. Use typedef to create a type vector2f that defines an array of 2 float values. Use this type when working with coordinate data in your program. Print the resulting bounding box and center to stdout using the format string %.2f,%.2f,%.2f,%.2f,%.2f,%.2f, following the pattern Imin, Ymin, Imaz, Ymax, l'center, Ycenter Save your code as bounding_box.c. Example Run $ ./a.out keypoints.txt 0.00,0.00,100.00,100.00,50.00,50.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Explain the tax attributes of a general partnership.

Answered: 1 week ago