biological clock
'''
this application aimed to cauculate people's biological block about emotional(28), energy(23),intelligence(33)
based on their birth date and the date you wanna analyse, current date will be used without another data applied
'''
import datetime
import math
import numpy as np
import matplotlib.pyplot as plt
def dtime(date1,date2=datetime.date.today()):
#date1=datetime.date(1996,7,15) #随机填写一个值,有助于python明白你需要的数据类型
delta=(date2-date1).days
return(delta)
def colour(delta): #delta是虚参,起什么名字都是可以的,后面调用的时候赋予实际意义
emotion=delta % 28
energy=delta % 23
intelligence=delta % 33
x_e=2*math.pi*emotion/28
y_e=math.sin(x_e)
x_en=2*math.pi*energy/23
y_en=math.sin(x_en)
x_inte=2*math.pi*intelligence/33
y_inte=math.sin(x_inte)
x=np.arange(0,2*np.pi,0.01)
y=np.sin(x)
plt.plot(x,y)
plt.plot([0,2*math.pi],[0,0])
plt.scatter(x_e,y_e,c=u'r')
plt.scatter(x_en,y_en,c=u'g',marker=u'*')
plt.scatter(x_inte,y_inte,c=u'b',marker=u'^')
plt.xlabel('o-red:emotion,*-green:energy,^-blue:intelligence')
plt.show()
birthdate=datetime.date(1997,8,15)
d=dtime(birthdate)
colour(d) #第一个图,代表当天的状态
adate=datetime.date(2019,6,1)
bdate=birthdate+datetime.timedelta(days=100)
d2=dtime(birthdate,bdate)
colour(d2) #第二个图,代表第一百天的状态
biological clock的更多相关文章
- L325 如何睡觉
Getting enough shut-eye is one of life’s biggest challenges. It’s recommended that the average perso ...
- 纪录片- 睡眠追踪(Chasing sleep) (共6集)
传送门:https://www.bilibili.com/bangumi/play/ep120260/ 小贴士传送门:https://www.bilibili.com/video/av11887055 ...
- 修改Linux系统日期与时间date clock
先设置日期 date -s 20080103 再设置时间 date -s 18:24:30 为了永久生效,需要将修改的时间写入CMOS. 查看CMOS的时间: #clock -r 将当前系统时间写到C ...
- 操作系统页面置换算法(opt,lru,fifo,clock)实现
选择调出页面的算法就称为页面置换算法.好的页面置换算法应有较低的页面更换频率,也就是说,应将以后不会再访问或者以后较长时间内不会再访问的页面先调出. 常见的置换算法有以下四种(以下来自操作系统课本). ...
- Cesium应用篇:3控件(1)Clock
创建 跟Clock相关的主要有Animation控件和Timeline控件,通常两者会放在一起使用. 在Cesium中,Viewer默认开启这两个控件,如果你想要不显示控件,可以在Viewer初始化中 ...
- get back to the slower clock rate that allows it to save more power
http://www.howtogeek.com/177790/why-you-cant-use-cpu-clock-speed-to-compare-computer-performance/ Wh ...
- Clock rate
https://en.wikipedia.org/wiki/Clock_rate The clock rate typically refers to the frequency at which a ...
- clock()、time()、clock_gettime()和gettimeofday()函数的用法和区别【转】
转自:http://www.cnblogs.com/krythur/archive/2013/02/25/2932647.html 转自http://blog.sina.com.cn/s/blog_7 ...
- 最少clock
var elClock = document.getElementById("clock");var getTime = function(){ var _ = ['00','01 ...
随机推荐
- Csc”任务不支持“SharedCompilationId”参数。请确认该参数存在于此任务中,并且是可设置的公共实例属性
今天.NetCore2.1版本,建立Asp.net Core web应用程序项目时,报以下错误: 未能使用“Csc”任务的输入参数初始化该任务. “Csc”任务不支持“SharedCompilatio ...
- 洛谷1052(路径压缩后简单dp)
同POJ3744写法都是一样的. 距离太长无意义可以压缩,注意不是随便压的,想一想可以跟%T发生关系. #include <cstdio> #include <cctype> ...
- 转 错误:ORA-28002/ORA-65162 : the password will expire within 7 days 解决方法
今天在使用sqlplus时出现 =============================================== ERROR:ORA-28002: the password will e ...
- 利用apache限制IP并发数和下载流量控制
一,为什么要对IP并发数,下载流量进行控制 说正题之前,先给大家讲个故事,那是在2007年,我进了一家公司,当时我们正在给达芙妮做电子商务网,www.idaphne.com.从三月份开始做的吧,九月份 ...
- 我的NopCommerce之旅(8): 路由分析
一.导图和基础介绍 本文主要介绍NopCommerce的路由机制,网上有一篇不错的文章,有兴趣的可以看看NopCommerce源码架构详解--对seo友好Url的路由机制实现源码分析 SEO,Sear ...
- CSS布局之-强大的负边距
css中的负边距(negative margin)是布局中的一个常用技巧,只要运用得合理常常会有意想不到的效果.很多特殊的css布局方法都依赖于负边距,所以掌握它的用法对于前端的同学来说,那是必须的. ...
- web前端性能优化 (share)
本文转自:http://www.cnblogs.com/50614090/archive/2011/08/19/2145620.html 一. WEB前台的优化规则 一.尽量减少 HTTP 请求 有几 ...
- 新萝卜家园GHOST WIN7系统3专业装机版
系统来自系统妈:http://www.xitongma.com/ 系统概述 萝卜家园GHOST win7 64位装机旗舰版加快“网上邻居”共享速度:取消不需要的网络服务组件,系统支持Windows安装 ...
- 洛谷P1036 选数
题目描述 已知 n 个整数 x1,x2,…,xn,以及一个整数 k(k<n).从 n 个整数中任选 k 个整数相加,可分别得到一系列的和.例如当 n=4,k=3,4 个整数分别为 3,7,12, ...
- codevs 1390 回文平方数 USACO
时间限制: 1 s 空间限制: 128000 KB 题目等级 : 青铜 Bronze 题目描述 Description 回文数是指从左向右念和从右像做念都一样的数.如12321就是一个典型的回文数 ...