-1
I’m trying to create an analog clock and my idea was the following one would get the angle corresponding to the hour and then discover the position x e y of that angle in a circle and draw a line from the center of my watch up to the given positions to thus display the hands. But I’m having trouble getting the positions from that angle. My code so far is this:
calendar = Calendar.getInstance();
int h = Integer.valueOf(new SimpleDateFormat("hh").format(calendar.getTime()));
int m = Integer.valueOf(new SimpleDateFormat("mm").format(calendar.getTime()));
a = (h * 30) + (m / 2);