Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
795 B
1
Indexable
Never
import numpy as np
import matplotlib.pyplot as plt

# Original parabola
def original_parabola(x):
    return (8/25) * (x + 2.5)**2 + 1

# Inverse relation
def inverse_relation(x):
    return np.sqrt((25/8) * (x - 1)) - 2.5

# Generate x values
x_values = np.linspace(-10, 10, 400)

# Plot the original parabola
plt.plot(x_values, original_parabola(x_values), label='Original Parabola')

# Plot the inverse relation
plt.plot(x_values, inverse_relation(x_values), label='Inverse Relation')

# Add labels and legend
plt.xlabel('x')
plt.ylabel('y')
plt.title('Graph of Original Parabola and Its Inverse Relation')
plt.axhline(0, color='black',linewidth=0.5)
plt.axvline(0, color='black',linewidth=0.5)
plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)
plt.legend()

# Show plot
plt.show()
Leave a Comment