Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def fel1():
- print("adjon meg a szog merteket:", end = "\n")
- a= float(input())
- rad = math.radians(a)
- print(rad)
- #fel1()
- def fel2():
- print("adjon meg egy radian merteket:",end="\n")
- a=float(input())
- print(math.degrees(a))
- #fel2()
- def fel3(a1,a2,h):
- T = ((a1+a2)/2)*h
- print(T)
- #fel3(5,6,5)
- def fel4(a,h):
- T = a*h
- print(T)
- #fel4(5,6)
- def fel5():
- print("Adjon meg egy szamot", end = "\n")
- a = int(input())
- sum = 0
- for i in range(1,a):
- if a % i == 0:
- sum = sum + i
- print(sum)
- return sum
- #fel5()
- def fel6():
- print("Adja meg az X koordinatait a 3D terben", end=" ")
- x1 = int(input())
- x2 = int(input())
- x3 = int(input())
- print("Adja meg az Y koordinatait a 3D terben", end=" ")
- y1 = int(input())
- y2 = int(input())
- y3 = int(input())
- tav = math.sqrt((x1-y1)**2+(x2-y2)**2+(x3-y3)**2)
- print(tav)
- #fel6()
- def fel7():
- print("Adja meg a ter dimenziojat:",end=" ")
- n = int(input())
- L = []
- K= []
- for i in range(2):
- print("Adja meg az ",i+1,"pont koordinatait",end="\n")
- for j in range(n):
- if i == 0:
- a = int(input())
- L.append(a)
- if i ==1:
- a = int(input())
- K.append(a)
- tav = 0
- for i in range(n):
- tav += (K[i]-L[i])**2
- print(math.sqrt(tav))
- #fel7()
- def fel8(L):
- L.reverse()
- print(L)
- #fel8([1,2,3]
- def fel9(bef1,bef2,atf):
- if atf**2 == bef1**2+bef2**2:
- print("Igaz")
- return True
- print("Hamis")
- return False
- #fel9(3,4,5)
- def fel10(x1,y1,x2,y2):
- print("Adja meg a pont kordinatait:",end="\n")
- x = int(input())
- y = int(input())
- if (x-x1) * (y2-y1) == (x2-x1)*(y-y1):
- print("Rajta van")
- else:
- print("Nincs rajta")
- #fel10(2,3,3,4)
- import matplotlib.pyplot as plt
- def fel11(x,y):
- plt.plot(x,y,'ro')
- #plt.plot(x,y)
- plt.xlabel("X")
- plt.ylabel("Y")
- plt.title("D.K.R")
- plt.show()
- #fel11([1,4],[8,1],)
- import numpy as np
- def fel12():
- fugv1 = np.arange(-4.,3,0.2)
- plt.xlabel("X")
- plt.ylabel("Y")
- plt.title("D.K.R")
- plt.plot(fugv1,fugv1,"r--",fugv1,fugv1**2,"bs",fugv1,fugv1**3,"g^")
- plt.show()
- #fel12()
- def fel13():
- x = np.arange(0, 4*np.pi, 0.1)
- y = np.sin(2*x)
- plt.plot(x,y)
- plt.show()
- #fel13()
- def fel14():
- k = np.sin(np.pi/6)
- print(round(k))
- #fel14()
- def fel15(L):
- Y = []
- a = len(L)
- e= 2.71
- for i in range(a):
- b = math.sin(L[i])+math.cos(L[i])
- nev = e**L[i]
- Y.append(b/nev)
- plt.plot(L,Y,"bs")
- plt.show()
- #fel15([1,2,3])
- def HF1():
- x = np.arange(-1,0,0.2)
- plt.plot(x,x+1)
- neg = np.arange(-2,-1,0.2)
- plt.plot(neg,neg+1,color = "red")
- plt.show()
- #HF1()
- def HF2():
- x = np.arange(0, 4 * np.pi, 0.1)
- y = np.sin(x)
- plt.plot(x, y)
- fugv1 = np.arange(-2,2,0.2)
- plt.plot(fugv1,fugv1**2-1,color = "red")
- plt.show()
- #HF2()
- def HF3():
- A = [1,3,2]
- B= [1,1,2.73]
- plt.plot(A,B,"bs")
- plt.show()
- #HF3()
- def HF4():
- kor = plt.Circle((0,0),3,color="red",fill=False)
- fig, ax = plt.subplots()
- plt.xlim(-5, 5)
- plt.ylim(-5, 5)
- ax.set_aspect(1)
- ax.add_artist(kor)
- plt.show()
- #HF4()
- def HF5():
- x = np.arange(-1,1,0.1)
- L = []
- for num in x:
- L.append(math.log(num**2,math.e))
- plt.plot(x,L)
- plt.show()
- #HF5()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement