Skip to content
Open

ww32 #106

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 1111.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ar_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dadada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_121.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_el_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig_lissag_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gesl_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gip_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions hw/1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import matplotlib.pyplot as plt

plt.plot([5,1, 1, 5,5], [1,1, 5, 5,1])
plt.savefig('fig_11.jpg')
13 changes: 13 additions & 0 deletions hw/2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import matplotlib.pyplot as plt
import numpy as np


def giperbola_plotter(x_min, x_max, N):

x = np.linspace(x_min, x_max, N)
y = 1/(x+0.1)

plt.plot(x, y, label='my giperbola')
plt.savefig('gip_33.png')
plt.close()
giperbola_plotter(-50, 50,10)
22 changes: 22 additions & 0 deletions hw/3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse

def circle_plotter(a=1,b=0.5):

x = np.arange(-2*a, 2*b, 14)
y = np.arange(-2*a, 2*b, 16)

# Переход к неявнозаданным координатам
X, Y = np.meshgrid(x, y)

fxy = X**2 + Y**2 - radius**2 # Уравнение окружности

# Команда рисования
plt.contour(X, Y, fxy, levels=[0])
plt.axis('equal')

plt.savefig('fig_4.png')


if __name__ == '__main__':
circle_plotter()
14 changes: 14 additions & 0 deletions hw/4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import matplotlib.pyplot as plt
import numpy as np
def logarifm_spir(b):
phi=np.arange(0,8*np.pi,0.01)
r=np.exp(b*phi)

x=r*np.cos(phi)
y=r*np.sin(phi)

plt.plot(x,y)
plt.savefig('fig_121.jpg')
logarifm_spir(0.11)


13 changes: 13 additions & 0 deletions hw/4_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import matplotlib.pyplot as plt
import numpy as np

def ar_spir(k):
phi=np.arange(0,8*np.pi,0.01)
r=k*phi

x=r*np.cos(phi)
y=r*np.sin(phi)

plt.plot(x,y)
plt.savefig('ar_1.jpg')
ar_spir(0.11)
14 changes: 14 additions & 0 deletions hw/4_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import matplotlib.pyplot as plt
import numpy as np
def gesl_spir(k):
phi=np.arange(0.01, 8*np.pi,0.01)
r=k/np.sqrt(phi)

x=r*np.cos(phi)
y=r*np.sin(phi)

plt.plot(x,y)
plt.axis('equal')
plt.savefig('gesl_1.jpg')

gesl_spir(1)
12 changes: 12 additions & 0 deletions hw/4_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import matplotlib.pyplot as plt
import numpy as np
def rosa_spir(k):
phi=np.arange(0,8*np.pi,0.01)
r=np.sin(k*phi)

x=r*np.cos(phi)
y=r*np.sin(phi)

plt.plot(x,y)
plt.savefig('rosa_1.jpg')
rosa_spir(10)
11 changes: 11 additions & 0 deletions hw/dop1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import matplotlib.pyplot as plt
import numpy as np
def fig_lissag(a=1, A=1, B=3,b=2):
t = np.linspace(0, 2 * np.pi, 500)
g=np.pi/2
x=A*np.sin(a*t+b)
y=B*np.sin(b*t)
plt.plot(x,y)
plt.savefig('fig_lissag_1.jpg')
plt.close
fig_lissag()
9 changes: 9 additions & 0 deletions hw/dop4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import matplotlib.pyplot as plt
import numpy as np
def stupenka(N):
x=np.arange(0,N+1,0.0005)
y=x//1
plt.plot(x,y)
plt.savefig('1111.png')
plt.close
stupenka(3)
11 changes: 11 additions & 0 deletions hw/dop_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import matplotlib.pyplot as plt
import numpy as np
def fig_el(p,e):
phi=np.arange(0,8*np.pi,0.01)
r=p/(1+e*np.cos(phi))
x=r*np.cos(phi)
y=r*np.sin(phi)
plt.plot(x,y)
plt.savefig('fig_el_1.jpg')
plt.close
fig_el(57,0.6)
9 changes: 9 additions & 0 deletions hw/dop_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import matplotlib.pyplot as plt
import numpy as np
def fig_el(x,a,b):
if x<a:
y=a**2
elif a<=x<=b:
y=x**2
else:
y=b**2
Binary file added lec_6/fig_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec_6/fig_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec_6/fig_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec_6/fig_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions lec_6/matplotlib.pyplot
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import matplotlib.pyplot as plt

# Построение графика по точкам
plt.plot([1, 44, 12], [1, 13, 33])
plt.savefig('fig_1.jpg') # Сохранение графика
17 changes: 17 additions & 0 deletions lec_6/ucrasheniya.pyplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import matplotlib.pyplot as plt

x = [3, 8, 5]
y = [7, 4, 9]

#plt.xkcd()

plt.plot(x, y, color='g', label='Graf 1', marker='>', ms=5)
plt.plot(y, x, color='r', label='Graf 2', marker='o', ms=3)

# --- Украшательства ---
plt.xlabel('Coord: x') # Подись оси ОХ
plt.ylabel('Coord: y') # Подпись оси ОУ
plt.legend() # Вызов "легенды"
plt.title('Base') # Общая подпись графика
plt.grid() # Подключение сетки
plt.savefig('fig_2.png')
20 changes: 20 additions & 0 deletions lec_6/yawnoe_zadanie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import matplotlib.pyplot as plt
import numpy as np


def parabola_plotter(a=1, b=1, c=0):

x = np.arange(-10, 10, 0.01)
y = a*x**2 + b*x + c

plt.plot(x, y, label='my parabola')
plt.xlabel('coord - x')
plt.ylabel('coord - y')
plt.title('Parabola plotter')
plt.legend()

plt.savefig('fig_3.png')


if __name__ == '__main__':
parabola_plotter()
23 changes: 23 additions & 0 deletions neyawn_zad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import matplotlib.pyplot as plt
import numpy as np


def circle_plotter(radius=10):

x = np.arange(-2*radius, 2*radius, 14)
y = np.arange(-2*radius, 2*radius, 16)

# Переход к неявнозаданным координатам
X, Y = np.meshgrid(x, y)

fxy = X**2 + Y**2 - radius**2 # Уравнение окружности

# Команда рисования
plt.contour(X, Y, fxy, levels=[0])
plt.axis('equal')

plt.savefig('fig_4.png')


if __name__ == '__main__':
circle_plotter()
Binary file added rosa_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.