i m creating a virtual wind vane on processing using a potentiometer .Using an Arduino for the same .
So the data to the processing program would be a number between 0 and 360 ( 0 corresponds to north exact ).
Say 0 is North exactly ,so a line starting from origin will point to 0 on a background picture of a degree wheel Im using .
I want the line to rotate by an angle according to the incoming data .
One way of doing this is to find the co-ordinates where i want the line to end on the picture and use switch() .But this makes the program too long .....imagine 360 cases .
Please tell me if u have an alternate idea to implement this .I hav included a sample code using switch() that I tried out and also the picture.
Thanks!!!