Question: Write a small C program. Where a and b are not both zero. The program should display a menu with the following options: a) Enter

Write a small C program. Write a small C program. Where a and b are not

Where a and b are not both zero.

The program should display a menu with the following options:

a) Enter points

b) Compute the distance

c) Display the line equation

d) Find the closest point to the line in c

e) Exit

The program will finalize ONLY when option e) is chosen.

Given the following list of point coordinates and label: Point Label X-Coordinate Y-Coordinate 50.2 45.7 76.7 12 75.8 48 99.1 14 48 25 23 36 123 34.6 Table 1: Point Information The information is given as three arrays: i) A char array named point_label, for column 1 in Table 1 ii A double array named x_coord, for column 2 in Table 1 iii)A double array named y coord, for column 3 in Table 1 The table information can be hard coded Given two points, entered using the labels (i.e. A and B), the program will compute: a) The distance between the two points b) The equation of the line crossing these points in the form: y mx+k c) Among the other points, the closest perpendicular point to the line described by the two points given(i.e. if A and B are chosen, then look for which of C,D,F,G are the closest) The distance from a point Po(Xo.yo) to a line in the form ax+by+c-0, is defined as: laxo byo +cl distance(ax + by + c = 0, P0)- 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!