-
Notifications
You must be signed in to change notification settings - Fork 2
Update 15.py #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update 15.py #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||||
import pylab | ||||||||
import numpy as np | ||||||||
from random import * | ||||||||
pi=np.pi | ||||||||
n=1000 | ||||||||
ts=np.linspace(0,12*pi,n) | ||||||||
xs=np.sin(ts)*(np.exp(np.cos(ts))-2*np.cos(4*ts)-np.sin(ts/12)**5) | ||||||||
ys=np.cos(ts)*(np.exp(np.cos(ts))-2*np.cos(4*ts)-np.sin(ts/12)**5) | ||||||||
|
||||||||
|
||||||||
map=[[0x8,0x8,0x7f,0x49,0x7f,0x8,0x8],[0x8,0x8,0x3e,0x2a,0x7f,0x14,0x63]] | ||||||||
R,C=7,7 | ||||||||
ds=5 | ||||||||
#m=int(input("> ")) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused code. |
||||||||
m = 1 | ||||||||
ds=20 | ||||||||
pylab.axis("off") | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest adding
Suggested change
|
||||||||
for r in range(R): | ||||||||
for L in range(len(map)): | ||||||||
for c in range(C-1,-1,-1): | ||||||||
if (map[L][r]>>c)%2: | ||||||||
a=2*pi*random() | ||||||||
sina=np.sin(a) | ||||||||
cosa=np.cos(a) | ||||||||
ra=(1/m)*(0.8+0.2*random()) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
for i in range(m): | ||||||||
for j in range(m): | ||||||||
|
||||||||
dx=(C-1-c)*ds+i*(ds/m)+L*(C+1)*ds | ||||||||
dy=(R-1-r)*ds+j*(ds/m) | ||||||||
|
||||||||
xs2=(cosa*xs-sina*ys)*ra+dx | ||||||||
ys2=(sina*xs+cosa*ys)*ra+dy | ||||||||
cs=[random()for k in range(3)] | ||||||||
pylab.fill(xs2,ys2,color=cs) | ||||||||
pylab.show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent using
from ... import *
.