In mathematics, the distance of a point with coordinates (x,y) from the origin is the square root of the sum of x-squared and y-squared. Assume that Point has already been defined as a structured type with two double fields, x and y, define a function getR that takes as an argument a value of type Point and returns the distance of that point from the origin (as described above).

In mathematics, the distance of a point with coordinates (x,y) from the origin is the square root of the sum of x-squared and y-squared. Assume that Point has already been defined as a structured type with two double fields, x and y, define a function getR that takes as an argument a value of type Point and returns the distance of that point from the origin (as described above).

LANGUAGE: C++

CHALLENGE:

In mathematics, the distance of a point with coordinates (x,y) from the origin is the square root of the sum of x-squared and y-squared. Assume that Point has already been defined as a structured type with two double fields, x and y, define a function getR that takes as an argument a value of type Point and returns the distance of that point from the origin (as described above).

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level