The values for temp_x_btm_left = 0 & temp_y_btm_left=1;
angle = 90;
//Moving the bottom left coordinates
_btm_left.real() = (temp_x_btm_left * cos(angle*PI/180))
- (temp_y_btm_left * sin(angle*PI/180));
_btm_left.imag() = (temp_x_btm_left * sin(angle*PI/180))
+ (temp_y_btm_left * cos(angle*PI/180));
The code is supposed to rotate the object 90 degrees counter-clockwise, which it does but the _btm_left.imag() returns a value really close to 0 = 1.437949e-009, and I really need it being 0.
I’ve tried setprecision() and setw() but it doesn’t seem to have any effect. Are there any methods for anything like this or do I need to create my own to solve this?!
As long as |v1-v2| < predefinedDelta, simply consider v1 == v2.