python 圆形分布

import math

a = [月中角度]
b = [每月例数]
n =总例数
i=0
fsin_all = 0
fcos_all = 0
for aa,bb in zip(a,b):
    bb = bb
    i+=1
    value = math.sin(aa/180.0*math.pi)*bb
    fcos = math.cos(aa/180.0*math.pi)*bb
    fsin_all +=value
    fcos_all +=fcos
    print('month',i,':  yuezhongjiaodu=',aa,'lishu=',bb,'fsin=',value,'fcos=',fcos)

print('fsin_all=',fsin_all,'fcos_all=',fcos_all)
print('y_mean=',fsin_all/n,'xmean=',fcos_all/n)
y=fsin_all/n
x=fcos_all/n
print('arfa=',math.atan(y/x)*180/math.pi+180)
arfa=math.atan(y/x)*180/math.pi+180
print('tianshu=',arfa*365/360.0)

r = math.sqrt(x**2+y**2)
print('r=',r)
s = 122.9548*math.sqrt(-math.log(r))
print('s=',s,'r=',r)

print('r0.05=',math.sqrt(3/(n+0.28)))

注意:122.95479628483989=180/math.pi*math.sqrt(2)*math.sqrt(math.log(10))

import tensorflow as tf

with tf.Session() as sess:
    b=0
    a = sess.run(tf.random_normal([28], mean=4.62, stddev=2.58))
    print('tf.random_normal([100000], mean=9.67, stddev=2.795)')
    print(a)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值