代码:Python获取黄金分割比例

电脑技术 电脑技术 1305 人阅读 | 6 人回复 | 2022-04-01

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
也可以自己写代码计算,Scipy提供了现成的常量.
  1. from scipy.constants import *
  2. print(golden)
  3. print(golden_ratio)
复制代码




回答|共 6 个

自然 发表于 2022-4-1 18:04:58| 字数 14 来自手机 | 显示全部楼层

真有意思,一窍也不通,哈哈!

Starrry 发表于 2022-4-1 18:37:00| 字数 38 | 显示全部楼层

有人尝试列出Golden Ratio长达几千个小数点,我记得是1.6.....

蓝莓糖 发表于 2022-4-1 21:04:04| 字数 74 | 显示全部楼层

Starrry 发表于 2022-4-1 18:37
有人尝试列出Golden Ratio长达几千个小数点,我记得是1.6.....

那么到底什么叫做黄金比例呢

Starrry 发表于 2022-4-1 21:06:53| 字数 609 | 显示全部楼层

蓝莓糖 发表于 2022-4-1 21:04
那么到底什么叫做黄金比例呢

主要是这个方程式,具体我也不是很懂,哈哈。

1111.png


This is the ratio of dividing a line segment A into two parts B and C such that A is to B as B is to C.

                                    A
                        ------------+-------
                              B        C

This deceptively simple ratio has fascinated mathematicians for centuries.
It can be written as A/B = B/C.

The ratio A/B is usually designated by the Greek letter phi, and it is approximately equal to 1.618.

Now if your task were to simply output "1.618", it wouldn't be much of a challenge. Printing a text string would do. The challenge is that your entry must print the value of phi for 2400 places after the decimal point, rounded to the nearest value. You may use a text string if you want, but it's very unlikely to be a winning strategy.

蓝莓糖 发表于 2022-4-1 21:11:04| 字数 70 | 显示全部楼层

Starrry 发表于 2022-4-1 21:06
主要是这个方程式,具体我也不是很懂,哈哈。

谢谢告知,大概就是一个线段分成两段,然后得到的比例吧

willsonlincake 发表于 2022-4-1 23:56:50| 字数 67 来自手机 | 显示全部楼层

Starrry 发表于 2022-4-1 21:06
主要是这个方程式,具体我也不是很懂,哈哈。

我也得研究下,为啥黄金分割在设计上这么受欢迎.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

热门推荐