1
kokutou 2015-03-20 15:00:50 +08:00 via Android 1
360/5=72度
然后三角函数算三角形另外一边的边长咯。 |
3
b821025551b 2015-03-20 15:05:37 +08:00
很显然的三角函数,sin(1/2),cos(1/2)神马的
|
4
ieiayaobb 2015-03-20 15:09:42 +08:00
请找初中同学做解析几何
|
5
justfly 2015-03-20 15:17:42 +08:00
极坐标转直角坐标 去搜一下吧 好久 都忘了
|
6
b821025551b 2015-03-20 15:21:58 +08:00 2
我无聊了
|
7
babyname OP |
8
babyname OP |
9
b821025551b 2015-03-20 15:51:50 +08:00
@babyname 周五闲着没事,用PS简单画了一下 :)
|
10
mengzhuo 2015-03-20 15:55:44 +08:00 via iPhone
0,0 为圆心
50px为半径 大部分编程语言的三角函数用弧度制 要画圆,所以theta 为 0 到 2 * pi 要六等份即 pos = [0,1/3pi,2/3pi,pi,4/3pi,5/3pi] function (){ a = [] for p in pos { a.append( (sin(p), cos(p)) } return a } 蹲坑手机上打的 没验证过 |
11
staticor 2015-03-20 16:55:14 +08:00
难道是大一作业...
|
13
b821025551b 2015-03-20 17:17:03 +08:00
@Freakr 初中可解,貌似大学高数的前几节也有这个(当年高数重修了4次的泪奔了)
|
14
mengzhuo 2015-03-20 17:46:01 +08:00 1
|
15
wodesuck 2015-03-20 19:51:53 +08:00
我来一个用复数的
base = (-1) ** (1 / 3) * 50 points = [base ** i for i in range(0, 6)] 复数乘法即是向量旋转 (py3代码,py2貌似算不了负数的开方 |
16
huxiao1104 2015-03-20 20:10:58 +08:00
用极坐标就行了吧
|
17
wodesuck 2015-03-20 20:12:25 +08:00
|
18
yingluck 2015-03-20 20:16:13 +08:00
什么是均匀分布?应该有无数个解吧
|
19
lololol233 2015-03-21 10:25:11 +08:00
|
20
yingluck 2015-03-21 16:10:01 +08:00
@lololol233
是的,现在的场景是一个个的像素, 而不是笛卡尔坐标系上一个个的点 补充一下: 第一个点在 (0, pi/3] 区间内解才是不重复的。 把弧拉直算经过的像素,和原始的弧经过的像素数量是不一样的。 |
21
rale 2015-03-21 17:28:07 +08:00
@b821025551b 你这个图是用啥画的呀
|
22
lololol233 2015-03-22 05:41:09 +08:00
|
23
lololol233 2015-03-22 05:50:59 +08:00
|
24
b821025551b 2015-03-22 13:54:51 +08:00
@rale Photoshop
|
25
yingluck 2015-03-23 15:08:07 +08:00 1
大概想了一下,可能还不全面,欢迎讨论
其实我觉得楼主说的每个点 10 像素是不太恰当的。 因为在画布上 9个像素 或者 16 个像素 能够拼成正方形。 围绕画布的中心,那我们假设画布的中心是笛卡尔坐标系的原点。那么六个点每个点到画布中心的距离都是50像素。 再假设每个像素宽高相同。六个点的每一个点都由 9 个像素组成。 那么,以原点为圆心,半径为 50 ,画出的圆经过的每一个像素点,都是六边形的六个端点可能的位置。 在第一象限,用脚本跑了一下,当横坐标是整数的时候,纵坐标的情况是这样的: 当纵坐标为整数时,可能的中心点有 4 个, 在第一象限有 6 个纵坐标为整数的点 当纵坐标为非整数时,可能的中心点有 2 个, 在第一象限有 45 个这样的点 所有不重复的结果有 87 个。 全部有 348 个可能的点。 |
26
yingluck 2015-03-23 15:09:12 +08:00
the X is 50, the Y is 0.0
cross (50, 0.0), (49, 0.0) the X is 49, the Y is 9.94987437107 cross (49, 9), (48, 9) the X is 48, the Y is 14.0 cross (48, 14.0), (47, 14.0), (48, 13.0), (47, 13.0) the X is 47, the Y is 17.0587221092 cross (47, 17), (46, 17) the X is 46, the Y is 19.5959179423 cross (46, 19), (45, 19) the X is 45, the Y is 21.7944947177 cross (45, 21), (44, 21) the X is 44, the Y is 23.7486841741 cross (44, 23), (43, 23) the X is 43, the Y is 25.5147016443 cross (43, 25), (42, 25) the X is 42, the Y is 27.1293199325 cross (42, 27), (41, 27) the X is 41, the Y is 28.6181760425 cross (41, 28), (40, 28) the X is 40, the Y is 30.0 cross (40, 30.0), (39, 30.0), (40, 29.0), (39, 29.0) the X is 39, the Y is 31.2889756943 cross (39, 31), (38, 31) the X is 38, the Y is 32.4961536185 cross (38, 32), (37, 32) the X is 37, the Y is 33.6303434416 cross (37, 33), (36, 33) the X is 36, the Y is 34.6987031458 cross (36, 34), (35, 34) the X is 35, the Y is 35.7071421427 cross (35, 35), (34, 35) the X is 34, the Y is 36.6606055596 cross (34, 36), (33, 36) the X is 33, the Y is 37.563279942 cross (33, 37), (32, 37) the X is 32, the Y is 38.4187454246 cross (32, 38), (31, 38) the X is 31, the Y is 39.2300904919 cross (31, 39), (30, 39) the X is 30, the Y is 40.0 cross (30, 40.0), (29, 40.0), (30, 39.0), (29, 39.0) the X is 29, the Y is 40.7308237088 cross (29, 40), (28, 40) the X is 28, the Y is 41.4246303544 cross (28, 41), (27, 41) the X is 27, the Y is 42.083250825 cross (27, 42), (26, 42) the X is 26, the Y is 42.7083130081 cross (26, 42), (25, 42) the X is 25, the Y is 43.3012701892 cross (25, 43), (24, 43) the X is 24, the Y is 43.8634243989 cross (24, 43), (23, 43) the X is 23, the Y is 44.3959457608 cross (23, 44), (22, 44) the X is 22, the Y is 44.8998886413 cross (22, 44), (21, 44) the X is 21, the Y is 45.3762052182 cross (21, 45), (20, 45) the X is 20, the Y is 45.8257569496 cross (20, 45), (19, 45) the X is 19, the Y is 46.2493243194 cross (19, 46), (18, 46) the X is 18, the Y is 46.6476151588 cross (18, 46), (17, 46) the X is 17, the Y is 47.021271782 cross (17, 47), (16, 47) the X is 16, the Y is 47.3708771293 cross (16, 47), (15, 47) the X is 15, the Y is 47.6969600708 cross (15, 47), (14, 47) the X is 14, the Y is 48.0 cross (14, 48.0), (13, 48.0), (14, 47.0), (13, 47.0) the X is 13, the Y is 48.2804308183 cross (13, 48), (12, 48) the X is 12, the Y is 48.538644398 cross (12, 48), (11, 48) the X is 11, the Y is 48.774993593 cross (11, 48), (10, 48) the X is 10, the Y is 48.9897948557 cross (10, 48), (9, 48) the X is 9, the Y is 49.1833305094 cross (9, 49), (8, 49) the X is 8, the Y is 49.355850717 cross (8, 49), (7, 49) the X is 7, the Y is 49.5075751779 cross (7, 49), (6, 49) the X is 6, the Y is 49.638694584 cross (6, 49), (5, 49) the X is 5, the Y is 49.7493718553 cross (5, 49), (4, 49) the X is 4, the Y is 49.8397431775 cross (4, 49), (3, 49) the X is 3, the Y is 49.9099188539 cross (3, 49), (2, 49) the X is 2, the Y is 49.9599839872 cross (2, 49), (1, 49) the X is 1, the Y is 49.9899989998 cross (1, 49), (0, 49) the X is 0, the Y is 50.0 cross (0, 50.0), (0, 49.0) the length of PIXLE is 87 |
27
yingluck 2015-03-23 15:09:39 +08:00
@lololol233 看上面
|
29
yingluck 2015-03-23 15:54:00 +08:00
|
32
Todd_Leo 2015-03-23 16:34:31 +08:00
为什么你的问题跟你的头像这么雷同 XD
|
34
wind3110991 2015-03-24 00:33:28 +08:00
这个题时要求什么,是反求输入六个点的坐标的话,那么这题答案不止一个哦
记得三个点确定一个圆,起码除了中心点的话要知道其他两个点的坐标,这题如果要求解,那么应该是输入中心点,加上其他两个点的坐标,求出剩下4个点的坐标 |