That's the code that I did but there is an extra star in sin(90)
and the negative wave is made of an extra star in each row
If Anyone can help, I will be grateful
I don't think your premise is correct, sin(190) looks like it's correctly the negative of sin(170). And if it's just sin(90) that's has an extra star, then that would mean you want it to be lower than sin(80), which makes no sense...
Can you please clarify your requirements?
Should an output of 0.0 produce 0 stars, or 1 star?
Should an output of -1.0 produce 21 stars, 20 stars, or 19 stars?
Should an output of +1.0 produce 21 stars, 20 stars, or 19 stars?
In your current setup, it looks like:
* 0.0 maps to 1 star + 0
* 1.0 maps to 1 star + 19 stars to the right
* -1.0 maps to 1 star + 19 stars to the left
is this not accurate? It seems alright to me, but please clarify what you want.