...

/

Challenge: Calculate Distance Between Two Points

Challenge: Calculate Distance Between Two Points

This challenge will test your knowledge of structs.

We'll cover the following...

Problem Statement

  • A struct Point is given which has two items, x and y.

  • The function test is given which has two instances of points initialized with some value of x and y.

  • The task is to calculate the distance between the two points.

    The distance between two points is: (x1x2)2+(y1y2)2\sqrt{(x1 - x2)^2+(y1 - y2)^2} ...