Hey Guys, I am trying to write a program in which the alphabets are rotating in a circle with constant speed. this is my code for drawing the characters in a circle and then rotating them in a circle. the first angle draws them, and the theta rotates them. the starting value of theta is 0 and it changes every frame. what I need to do is to make a textbox in the bottom so that when the mouse is clicked, only the character which is at the top if the circle gets displayed. any help would be greatly appreciated. the values of CenterX and Y are the middle of the canvas

for(i = 'a' ; i < 'z' ; i++){
angle = (i/26.0)*(2*PI);
x = (CenterX)+cos(angle+theta)*radius;
y = (CenterY)+sin(angle+theta)*radius;
textSize(20);
text(i, x, y);
theta += 0.005;
}

I’ve already made the circle, I need help with the next part. which is to print the character at the top of the circle when the mouse is clicked. my for loop is working

Hmm, you could probably do so, by doing something like :
println(x+anglecalculation);
Where x = ‘a’ and anglecalculation is so that if it is a, then it is 0 and if it is b then 1 and so on.
Need Your Code to give you a more precise answer.

can you look at this code above and tell me what to put in the mouseClicked function. so that it prints the angle on the top of the circle on the rectangle created.

I can‘t just Post the Solution, since it‘s an assignment, But i‘ll explain how to get it done with you code right now. In the Alphabets.charAt() method, put ‘A’ - the inverse calculation you did in your for loop in drawChar() for angle.

Actually no, that Would only work if you knew the top letter beforehand… how do you rotate this Wheel? If there is a function that adds an rotazionale Offset, just get that and set the Alphabet.charAt() to it… Or if it‘s already an angle, inverse the calculation for it. Same as i said with angle, just that i falsely assumed that was used to rotate the wheel.
Edit: just use int(float) to turn it into int.