You are asked to write the computer functions with the following function declar
ID: 3774281 • Letter: Y
Question
You are asked to write the computer functions with the following function declarations in C. For each determine if it is possible. If so, a) give the formal description of the mathematical function represented , b) determine if it is onto, and c) determine if it is one-to-one.
(a) double findLength(double x, double y, double z);
Purpose: given the coordinates of a vector, (x, y, z), the function returns the length of the vector using sqrt(x^2 + y^2 + z^2) .
(b) void findVector(double length, double *x, double *y, double *z);
Purpose: given the length of a vector, the function uses pointers to “return” the coordinates of the specific vector that had this length.
You are not being asked to provide code.
Explanation / Answer
double findLength(double x, double y, double z){
return sqrt(x^2 + y^2 + z^2);
}
void findVector(double length, double *x, double *y, double *z)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.