Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy import *
- from numpy import *
- from random import*
- q=complex(2,0)
- w=complex(-2,0)
- e=complex(0,-2)
- vas=complex(0,0)
- def f(a,b,c):
- return ((b-c)*(abs(a)**2.0) + (c-a)*(abs(b)**2.0) + (a-b)*(abs(c)**2.0))/(((b-c)*(conj(a)) + ((c-a)*conj(b)) + ((a-b)*conj(c))))
- print "Test:", f(q,w,e),"\n"
- for i in range(1,10):
- h11=randint(0,360)
- h11=h11* pi/180
- h1= cos(h11)
- j1= sin(h11)
- a=complex(h1,j1)
- h22=randint(0,360)
- h22= h22* pi/180
- h2= cos(h22)
- j2= sin(h22)
- b=complex(h2,j2)
- h33=randint(0,360)
- h33=h33* pi/180
- h3= cos(h33)
- j3= sin(h33)
- c=complex(h3,j3)
- print "Points:","a:",a,"b:",b,"c:",c
- print "Function value:",f(a,b,c)
- print "-------------------------------------------------------------------"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement