'''
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的更多相关文章

  1. L325 如何睡觉

    Getting enough shut-eye is one of life’s biggest challenges. It’s recommended that the average perso ...

  2. 纪录片- 睡眠追踪(Chasing sleep) (共6集)

    传送门:https://www.bilibili.com/bangumi/play/ep120260/ 小贴士传送门:https://www.bilibili.com/video/av11887055 ...

  3. 修改Linux系统日期与时间date clock

    先设置日期 date -s 20080103 再设置时间 date -s 18:24:30 为了永久生效,需要将修改的时间写入CMOS. 查看CMOS的时间: #clock -r 将当前系统时间写到C ...

  4. 操作系统页面置换算法(opt,lru,fifo,clock)实现

    选择调出页面的算法就称为页面置换算法.好的页面置换算法应有较低的页面更换频率,也就是说,应将以后不会再访问或者以后较长时间内不会再访问的页面先调出. 常见的置换算法有以下四种(以下来自操作系统课本). ...

  5. Cesium应用篇:3控件(1)Clock

    创建 跟Clock相关的主要有Animation控件和Timeline控件,通常两者会放在一起使用. 在Cesium中,Viewer默认开启这两个控件,如果你想要不显示控件,可以在Viewer初始化中 ...

  6. 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 ...

  7. Clock rate

    https://en.wikipedia.org/wiki/Clock_rate The clock rate typically refers to the frequency at which a ...

  8. clock()、time()、clock_gettime()和gettimeofday()函数的用法和区别【转】

    转自:http://www.cnblogs.com/krythur/archive/2013/02/25/2932647.html 转自http://blog.sina.com.cn/s/blog_7 ...

  9. 最少clock

    var elClock = document.getElementById("clock");var getTime = function(){ var _ = ['00','01 ...

随机推荐

  1. Centos 7.x 搭建 Zabbix3.4

    前提要安装了LAMP(官方推荐环境) LNMP也可以 一.安装.配置Zabbix3.4 1:安装zabbix_RPM包 rpm -i https://repo.zabbix.com/zabbix/3. ...

  2. LocalBroadcastManager

    LocalBroadcastManager mLocalBroadcastManager; BroadcastReceiver mReceiver; //注册通知 mLocalBroadcastMan ...

  3. fake-useragent

    在编写爬虫进行网页数据的时候,大多数情况下,需要在请求是增加请求头 python下非常好用的伪装请求头的库:fake-useragent,具体使用说明如下: 安装fake-useragent库 pip ...

  4. ArrayList简单学习

    类声明: public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomA ...

  5. VMware的linux虚拟机实现和windows的文件共享

    使用的centos7和windows10,在虚拟机centos7中是root身份.由于是第一次用没有界面的linux,可谓是困难重重…… 一 打开VMware,然后选中你的虚拟机,我的是centos7 ...

  6. 100 Same Tree 相同的树

    给定两个二叉树,写一个函数来检查它们是否相同.如果两棵树在结构上相同并且节点具有相同的值,则认为它们是相同的.示例 1:输入 :      1         1             / \    ...

  7. IIS+PHP访问量大时内存爆满等性能问题解决方案

    如今还是有许多人在用老掉牙的 IIS6 + PHP.本文解决方法适用于使用 FastCGI 运行 PHP 的用户. 问题原因: 你可以试一试,你在 VPS 上用 IIS6 安装 FastCGI 跑 P ...

  8. vue 引用其他组件

    1.在components 目录下新建Test.vue 文件 <template> <div class="test"> <h1>{{ msg ...

  9. 60分钟课程: 用egg.js实现增删改查,文件上传和restfulApi, webpack react es6 (一)

    今天开始我将写nodejs框架egg.js, react 实现的增删改查,文件上传等常用的b/s场景,这个将分3部分来写. 会让你在60分钟内快速 入口并应用~  你应该用es6, node,或是ph ...

  10. Java中IO流文件读取、写入和复制

    //构造文件File类 File f=new File(fileName); //判断是否为目录 f.isDirectory(); //获取目录下的文件名 String[] fileName=f.li ...