Test points in a circle of radius M, around the centre of the clock. (You could use a for loop to vary the angle from -pi to pi.)
First set M so that the long hand will touch the circle but not the short hand. You will find a region of black points and these reveal the angle of the long hand.
Then repeat with smaller M, so your circle will cross both hands. If you identify two different black areas, you can decide which one is the long hand due to the previous step. (But if the hands are overlapping you may not see two different areas.)