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 ...
随机推荐
- JS高级学习历程-1
JS高级-34-昨天内容回顾 时间:2015-5-11 1.DOM获取元素节点 document.getElenmentById(id 属性值) ...
- JSP | 基础 | Button跳转页面
<input type = "button" value = "登陆" onclick = "window.location.href = 'L ...
- CSS 两边是线 中间是文字的效果
刚开始做的时候 想了一下 这个是怎么做出来的,后来在网上看到有个类似的效果,研究一下 <!DOCTYPE html> <html lang="en"> &l ...
- 计算机中如何实现除数是2的幂次的除法【转载自CSDN】
前言: 本来是在看汇编里面的数据条件传送指令,做习题的时候看着这么一道有关于2的幂次方除法的题目.结果傻眼了,又尼玛不会了.........第二章看的时候就稀里糊涂的,看了几遍也没看太懂,这回又涉及到 ...
- HTML表格的基本结构标记
<table>标记 1.基本格式:<table 属性1="属性值1" 属性2="属性值2" ... ...>表格内容</table ...
- Python相对导入导致SystemError的解决方案(译)
原文出处: http://stackoverflow.com/ 译文出处:yibohu1899 这个问题是如何解决在相对导入的时候,如果出现’System Error’的时候的解决方案.顺带一提, ...
- Dubbo理论知识
本文是作者根据官方文档以及自己平时的使用情况,对 Dubbo 所做的一个总结.如果不懂 Dubbo 的使用的话,可以参考我的这篇文章<超详细,新手都能看懂 !使用SpringBoot+Dubbo ...
- Spark Mllib里如何将trainDara训练数据文件里提取第M到第N字段(图文详解)
不多说,直接上干货! 具体,见 Hadoop+Spark大数据巨量分析与机器学习整合开发实战的第13章 使用决策树二元分类算法来预测分类StumbleUpon数据集
- Java 图形界面开发--图文并茂建立学生管理系统
(尊重劳动成果,转载请注明出处:http://blog.csdn.net/qq_25827845/article/details/50932501 冷血之心的博客) 图形用户界面(Graphics U ...
- java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/xxx/lib/arm/liblame.so: has text relocations
最近在写本地录音转码过程中引入了liblame.so,我这边用了不同系统版本的手机测试本地录音都没有出现问题,但是有一天,同事在测试的时候,出现了以下错误: 09-13 17:32:29.140 26 ...