adds vector B to vector A Vect& operator+=( Vect& vectA, const Vect& vectB )
What will be an ideal response?
```
{
double xcomp, ycomp;
xcomp = vectA.xcomponent( vectA ) + vectB.xcomponent( vectB );
ycomp = vectA.ycomponent( vectA ) + vectB.ycomponent( vectB );
vectA.r = sqrt( (xcomp * xcomp) + (ycomp * ycomp));
vectA.theta = atan( ycomp / xcomp );
//if quadrant II, add Pi
if( xcomp > 0 && ycomp < 0 )
vectA.theta += Pi;
//if quadrant III, add Pi
else if( xcomp < 0 && ycomp < 0 )
vectA.theta += Pi;
//if quadrant IV, add 2*Pi
else if( xcomp > 0 && ycomp < 0 )
vectA.theta += 2 * Pi;
return vectA;
```
You might also like to view...
If some field values contain data with a consistent pattern, you should define an input mask
Indicate whether the statement is true or false
How can user-centered development benefit developers? List at least three advantages.
What will be an ideal response?