Revert commit cd49dc0
commited
commit
ba7fa71e38cf2e3167cdd1c1e2490fb5f0d7c487
... | ... | @@ -29,15 +29,15 @@ Here we go! A perfect regular hexagon! |
29 | 29 | |
30 | 30 | ## Advanced method |
31 | 31 | |
32 | Instead of creating the list of positions, they can be calculated in Fancade using trigonometric functions. Using this method, we can also create regular polygons with a different number of sides! |
|
32 | Instead of creating the list of positions, they can be calculated in Fancade using trigonometric functions. Using this method, we can also create regular polygons with different number of sides! |
|
33 | 33 | |
34 | We need three additional variables. Variable **N** is the number of sides of our polygon, while **X** and **Z** denotes the size of our original square object. |
|
34 | We need three additional variables. Variable **N** is the number of sides of our polygon, while **X** and **Z** denote the size of our original square object. |
|
35 | 35 | |
36 | 36 | Now we need to calculate the vector from the origin of our polygon to the origin of our square object. We're going to call it **A**. Its X and Y coordinates are both equal to 0, while the Z coordinate can be computed using trigonometry: |
37 | 37 | |
38 | 38 | **A** = (0, 0, 0.5(**Z** - **X** ⋅ cot(180°/**N**))). |
39 | 39 | |
40 | This is how it looks in Fancade. Here we use the fact that the cotangent of an angle is equal to its cosine divided by its sine: |
|
40 | This is how it looks in Fancade. Here we use the fact that cotangent of an angle is equal to its cosine divided by its sine: |
|
41 | 41 | |
42 | 42 | [[/uploads/Screenshot_20210423-180421~2.jpg | height = 180px]] |
43 | 43 | |
... | ... | @@ -45,7 +45,7 @@ Now, to calculate the positions of the remaining pieces, we can subtract **A** f |
45 | 45 | |
46 | 46 | [[/uploads/Screenshot_20210423-180438~2.jpg | height = 500px]] |
47 | 47 | |
48 | For **N** = 6 and **X** = **Z** = 1, we obtain the exact same hexagon as in the classic method, without using any additional lists! After changing the value of **N**, we can obtain different polygons, for instance, a pentagon: |
|
48 | For **N** = 6 and **X** = **Z** = 1, we obtain the exact same hexagon as in the classic method, without using any additional lists! After changing the value of **N**, we can obtain different polygons, for instance a pentagon: |
|
49 | 49 | |
50 | 50 | [[/uploads/Screenshot_20210423-183301~2.jpg | height = 200px]] |
51 | 51 |