N 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. given a variable, p that is of type point-- a structured type with two fields, x and y, both of type double, write an expression whose value is the distance of the point represented by p from the origin.

Respuesta :

W0lf93
Let the distance of the point be P. From the question, the distance, P, is square root of the sum of the coordinates (x, y); so we have (X^2, Y^2) From the origin we have (0, 0) From elementary mathematics, distance of a point is . âš(X2 -X1)^2 - (Y2 - Y1)^2 So basically this is just the difference of the squares at varying points of X and Y. At the origin, X1 = 0 and Y1 = 0 and so our equation reduces to âš(X2-0)^2 + (Y2 -0)^2. This becomes P =âšX^2 + Y^2