Computer Science, asked by tanaithrinesh1999, 5 months ago

Write a program to find distance between two points using 4 functions.

Answers

Answered by Gopalsethi202
1

Explanation:

Program description:- Write a C program to find the distance between two given points.

The distance formula is derived from the Pythagorean theorem. To find the distance between two points (x1, y1) and (x2, y2), all that you need to do is use the coordinates of these ordered pairs and apply the formula.

Distance Formula

Assume we have two points M and N, with coordinates (x1, y1) and (x2, y2) respectively. Their distance can be represented as MN and it can be calculated as given below formula,

The first point (M):- (x1, y1)

The first point (M):- (x1, y1)Second point (N):- (x2, y2)

The first point (M):- (x1, y1)Second point (N):- (x2, y2)Distance (MN):- √((x2-x1)2 + (y2-y1)2)

Example:-

M = (4, 8)

M = (4, 8)N = (12, 14)

M = (4, 8)N = (12, 14)Then distance between M and N is, MN = √((12-4)2 + (14-8)2) = √(64 + 36) = √(100) = 10

PLEASE MARK TO BRAIN LIST. OK MY FRIEND

Similar questions