In a plane, standard practice is to measure angle as increasing in the counter-c
ID: 3704871 • Letter: I
Question
In a plane, standard practice is to measure angle as increasing in the counter-clockwise direction starting at the line appearing in the figure between Quadrant 4 and Quadrant 1 Quadrant Quadrant Craft a User-Defined Function (UDF) that " accepts an angle between 0 and 360° as the first variable in the input argument list returns one 3-element vector in the output argument list in which - the 1st element is the number of the quadrant containing that angle the 2nd element is the sine of the angle the 3rd element is the cosine of the angle " if the specified angle is not within the specified range - displays to the CW an easily understood error message - assigns a value of zero to each element in output argument list vector, - and returns without determining quadrant or computing values of sine and cosine Note 1: No data should be "echoed" to the CW When an angle falls on the boundary between quadrants it is called a cardinal angle and does not belong to any quadrant. For these angles, return a value of zero for the 1st element of the output argument list vector Note 2:Explanation / Answer
vector<int> anglefunc(double angle)
{
vector<int> v(3);
if(angle > 360 || angle < 0)
{
cout << "Angle outside of specified range" << endl;
v[0]=0;
v[1]=0;
v[2]=0;
return 0;
}
if(!angle%90)
v[0]=0;
else
v[0]=angle/90;
v[1]= sin (angle*PI/180);
v[2]= cos (angle*PI/180);
return v;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.