import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Define the parameters of the Complex Intuitionistic Fuzzy Number (CIFN)
# Membership function: μ(z) = e^(-|z|^2)
# Non-membership function: ν(z) = 1 - e^(-|z|^2)

# Create a grid for the complex plane
real = np.linspace(-2, 2, 100)
imag = np.linspace(-2, 2, 100)
real_grid, imag_grid = np.meshgrid(real, imag)
z = real_grid + 1j * imag_grid  # Complex numbers grid

# Define the membership and non-membership functions
membership = np.exp(-np.abs(z)**2)  # Membership function
non_membership = 1 - np.exp(-np.abs(z)**2)  # Non-membership function

# Plot the 3D visualization
fig = plt.figure(figsize=(14, 7))

# Membership function surface
ax1 = fig.add_subplot(121, projection='3d')
ax1.plot_surface(real_grid, imag_grid, membership, cmap='viridis', edgecolor='k')
ax1.set_title("Membership Function μ(z)", fontsize=14)
ax1.set_xlabel("Re(z)")
ax1.set_ylabel("Im(z)")
ax1.set_zlabel("μ(z)")

# Non-membership function surface
ax2 = fig.add_subplot(122, projection='3d')
ax2.plot_surface(real_grid, imag_grid, non_membership, cmap='plasma', edgecolor='k')
ax2.set_title("Non-Membership Function ν(z)", fontsize=14)
ax2.set_xlabel("Re(z)")
ax2.set_ylabel("Im(z)")
ax2.set_zlabel("ν(z)")

plt.tight_layout()
plt.show()
