I have this code, it works somewhat fine, when i compile in the terminal (mac), then it is supposed to print out 5 different radiances, the first and second are different, but the third, fourth and fifth is the same. I need to print out five different once. By the way, im a beginner and im using allosystem to compile my code. the code is below
#include <iostream>
#include <math.h>
class CirclePath{
public:
float x,y;
CirclePath(){
x = 0;
y = 0;
mAngle = 0;
mAngleInc = 0;
mRadius = 0;
Your question was a little bit ambiguous. If you are saying that 3, 4 and 5 were all the same as 2, then I think I see the problem. If you are saying that 3, 4 and 5 are all the same but distinct from 2 (and 1), then there is more to this than I am seeing right now.
Your problem is that you are always overwriting mAngle rather than incrementing it. So the first time through it is 0 at start and then gets set to 2/5 PI. The second time through it starts out as 2/5 PI and gets reassigned to the same value. So loops 2 - 5 all use 2/5 PI.
You probably meant to assign mAngle += mAngleInc;
By the way, please post code inside code tags. Just click the "<>" button on the Format: options and post your code between the tags. This will make it easier to read your code and refer to it in our responses.
Can you show in the code how to do what you decribe underneath.
"Your problem is that you are always overwriting mAngle rather than incrementing it. So the first time through it is 0 at start and then gets set to 2/5 PI. The second time through it starts out as 2/5 PI and gets reassigned to the same value. So loops 2 - 5 all use 2/5 PI."