After much deliberation and wandering into the unknown I make request to you: How to draw arc or semi-cyrcle in OpenGL or GLUT giving:
In your for loop you're incrementing your loop variable
i by 1 with each iteration. Yet your calculation of curve parameter
t does not take the number of steps into account. I'm kind of reluctant to give you the full solution, but here's a hint: You should divide by
segments somewhere. Also
segments likely is an integer, too, so you'll have to cast to
Now before you start spraying your code with
I want to you understand what you're doing there.