Skip to content

Commit 0faf55e

Browse files
committed
input command added for parameters "a" and "b"
1 parent 8b4bdbe commit 0faf55e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ellipse_def_plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import numpy as np
33
import matplotlib.pyplot as plt
44
# Function to plot Ellipse
5+
a = int(input("Enter the value of a: "))
6+
b = int(input("Enter the value of b: "))
57
def plot_ellipse(a, b, ax):
68
x = np.linspace(-10, 10, 400)
79
y1 = b * np.sqrt(1 - (x**2 / a**2))
@@ -16,7 +18,7 @@ def plot_ellipse(a, b, ax):
1618
ax.set_xlim(-10, 10)
1719
ax.set_ylim(-10, 10)
1820
# Plot ellipse with a=8, b=4
19-
plot_ellipse(8, 4, ax)
21+
plot_ellipse(a, b, ax)
2022
# Add labels and title
2123
ax.set_xlabel('X-axis')
2224
ax.set_ylabel('Y-axis')

0 commit comments

Comments
 (0)