adds two vectors Vect operator+( const Vect& vectA, const Vect& vectB )
What will be an ideal response?
```
{
double r, theta;
double xcomp, ycomp;
xcomp = vectA.xcomponent( vectA ) + vectB.xcomponent( vectB );
ycomp = vectA.ycomponent( vectA ) + vectB.ycomponent( vectB );
r = sqrt( (xcomp * xcomp) + (ycomp * ycomp));
theta = atan( ycomp / xcomp );
//if quadrant II, add Pi
if( xcomp > 0 && ycomp < 0 )
theta += Pi;
//if quadrant III, add Pi
else if( xcomp < 0 && ycomp < 0 )
theta += Pi;
//if quadrant IV, add 2*Pi
else if( xcomp < 0 && ycomp < 0 )
theta += 2 * Pi;
Vect sum( r, theta );
return sum;
}
```
You might also like to view...
Which form of analysis would you use to "sell" a systems project to a manager that is only interested in how many widgets will need to be sold before the project becomes profitable? Why?
What will be an ideal response?
The process of pixel ____ creates new pixels by averaging the colors of nearby pixels.
A. compression B. interpretation C. rasterization D. interpolation
COGNITIVE ASSESSMENT What component converts the AC power in a wall plug to the DC power required by a computer?
A. electrical alternator B. power supply C. AC/DC flip-flop power switch D. power surge and adaptation coordinator
Custom exceptions classes must derive from the System.SystemException class.
Answer the following statement true (T) or false (F)