摘要: X y 点 逆时针旋转b角到c d 如下 c= xcos(β)-ysin(β) d= ycos(β)+xsin(β) 顺时针也即坐标轴逆时针 s = os = oa + as = x cos(theta) + y sin(theta) t = ot = ay – ab = y cos(theta) 阅读全文
posted @ 2017-12-19 15:06 Anlovescode 阅读(1083) 评论(0) 推荐(0) 编辑
摘要: 每5个输出,加换行 加格式。 zhu 另一个答案 其他的答案正在寻找 有机会深入学一下format语句 阅读全文
posted @ 2017-12-11 11:15 Anlovescode 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 角度转弧度radians pi值 阅读全文
posted @ 2017-11-24 19:41 Anlovescode 阅读(136) 评论(0) 推荐(0) 编辑
摘要: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple C:\Users\mu\pip 新建pip.ini 阅读全文
posted @ 2017-11-21 17:11 Anlovescode 阅读(3475) 评论(0) 推荐(0) 编辑
摘要: import time time_start=time.time() time_end=time.time() print('totally cost',time_end-time_start) 阅读全文
posted @ 2017-10-25 15:53 Anlovescode 阅读(96882) 评论(0) 推荐(3) 编辑
摘要: array 的创建可以通过list给 array print出来像一个表格,可以按行按列来观察。 原来是一个list相当于一行 np.where用于寻找一个condition下的坐标,返回的是一个2个元素的tuple,第一个元素是一个array,第二个是数据类型 代码的作用是找到返回的下标里的最大值 阅读全文
posted @ 2017-10-25 15:52 Anlovescode 阅读(2203) 评论(0) 推荐(1) 编辑
摘要: 对某一个位置排列 此方法针对按每个list排列,按照第一列元素排序。 阅读全文
posted @ 2017-10-25 15:39 Anlovescode 阅读(419) 评论(0) 推荐(0) 编辑
摘要: mat = "{:20}\t{:28}\t{:32}" print(mat.format("占4个长度","占8个长度", "占12长度")) #如果需要居中输出在宽度前面加一个^ mat = "{:^20}\t{:^28}\t{:^32}" print(mat.format("占4个长度","占8个长度", "占12长度")) 阅读全文
posted @ 2017-10-20 17:10 Anlovescode 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 主要过程是读取的时候是一行字符串,需要Strip去除空格等,然后split变成一个List。 注意这时候数据结构是List但是每一个元素是Str性质的。 所以需要map(float,List) 把这个List变成一个新的List,里面每一个元素是Float类型的 然后write函数只能接受一个元素。 阅读全文
posted @ 2017-10-20 00:38 Anlovescode 阅读(699) 评论(0) 推荐(0) 编辑
摘要: 用自带的os模块或者分割split 路径 - - 注意python里获得的路径是/ 而不是\ RESTART: C:\Users\AN\Desktop\learn Python\IDEL.py testtest>>> 阅读全文
posted @ 2017-09-20 13:36 Anlovescode 阅读(711) 评论(0) 推荐(0) 编辑