0
Please I need an explanation from lines 58 to the end
Studying HTML graphics and saw this code for building an analog clock on a site.Now I don't understand the reasons for the negative radius in the code from lines 58 and why the Math.PI/6 https://code.sololearn.com/WrTqew0uY98A/?ref=app
9 Answers
+ 1
Math.PI radians is 180
degrees
Math.PI/6 is 30 degrees, the angle between the numbers of the clockface.
The radius also happens to be the height/2. the negative radius is used in the translate function to re center the number after the rotation.
0
Change the numbers to see what happens.
0
I did that earlier Chris Coder ...why the ang = num *Math.pI/6 .I do that and the results are not even angular
0
It's all jumbled up..spent more than an hour trying to figure it out
0
Well Chris Coder ,but this is not how I like to learn..I like knowing the theory behind whatever is done,so that I can face a similar issue.
0
I need to understand the code..Done all sorts of trial and error and I can't decipher the code
0
Thanks Bob_Li ,I'll make sure,I check out more on that negative radius and re center.
0
don't think of it as radius in translate. Think of it as height/2
look how radius was computed at the beginning of the code.