Menu
I am a new learner in Javascript. I am trying to create a dynamic code to change de sides of a “polygon” in the HTML when I select different number of the sides, for instance, a triangle to square (4 sides), and so on preserving the same space that its on the screen.
<poly id=”shape” <polygon id = “poly” points=”100,10 40,198 160,198 “>
<poly id=”shape” <polygon id = “poly” points=”x1,y1 x2,y2 x3,y3 x4,y4 “>
I read some information related to the shape’s angle, and I tried to apply, but it did not work. (Triangle angle 120, Square angle 90, Pentagon angle 72)
Did anyone face this challenge before?
Thanks in advance!