Question: #include #include #include part4.h // Set the x and y fields of the point structure pointed to by pt // to the x and y
| #include | ||||||||||||
| #include | ||||||||||||
| #include "part4.h" | ||||||||||||
| // Set the x and y fields of the point structure pointed to by pt | ||||||||||||
| // to the x and y values passed in as arguments. The point structure | ||||||||||||
| // is defined in the part4.h header file. | ||||||||||||
| // | ||||||||||||
| // This should only take a couple of lines. | ||||||||||||
| void | ||||||||||||
| set_point(struct point *pt, double x, double y) | ||||||||||||
| { | ||||||||||||
| // TODO: Your code here. | ||||||||||||
| assert(0); | ||||||||||||
| } | ||||||||||||
| // Compute the planar distance between two points. Recall that the | ||||||||||||
| // distance between two points in a plane is computed as follows. Label | ||||||||||||
| // the two points (x1, y1) and (x2, y2). Let dx be the difference | ||||||||||||
| // between x1 and x2 and dy be the difference between y1 and y2. The | ||||||||||||
| // distance between the two points is the square root of the sum of dx | ||||||||||||
| // squared plus dy squared. | ||||||||||||
| // | ||||||||||||
| // Hint: Use the sqrt function from math.h. You do not need to use | ||||||||||||
| // the pow function; x * x is sufficient to square a variable. | ||||||||||||
| double | ||||||||||||
| point_dist(struct point *pt1, struct point *pt2) | ||||||||||||
| { | ||||||||||||
| // TODO: Your code here. | ||||||||||||
| assert(0); | ||||||||||||
| return 0.0; | ||||||||||||
| } PART4.H:
|
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
