this post was submitted on 07 May 2025
17 points (90.5% liked)

Generative Art

134 readers
1 users here now

"Generative art" often refers to algorithmic art (algorithmically determined computer generated artwork).

founded 2 years ago
MODERATORS
 

6 hexagons are red, one blue, arranged in a honeycomb pattern, where 1 hexagon is surrounded by 6 others

Did you know a Hexagon can be constructed using the angle pi/3 a lot of times? This is because a hexagon is made of 6 triangles with equal side length - the radius of the hexagon. The inner angles of these triangles is pi/3. Using this information and the trigonometric functions sin and cos can be used to draw such a picture.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 5 days ago (3 children)

Why should i use that instead of math.pi?

[–] [email protected] 2 points 5 days ago

I missed the comment that said you should. Did they delete it?

[–] [email protected] 1 points 5 days ago

You're right. But as the other commenter suggested, if you're on an embedded system or otherwise limited system, or even using another language missing certain constants and/or functions, it's a good thing to know.

You could also just pull the constant from memory, assuming you have the brain memory space that I apparently have...

3.1415926535897932384646233832795020841971693993751

[–] [email protected] 1 points 5 days ago

If you're using an embedded version of Python that's missing the math module. Because somebody couldn't be bothered to fix the floating point math in C for platforms that don't have an FPU 🤷