import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
n = 5000
r = np.random.rand(n) ** 0.5
theta = np.random.uniform(0, 2 * np.pi, n)
phi = np.random.uniform(0, np.pi, n)
x = r * np.sin(phi) * np.cos(theta)
y = r * np.sin(phi) * np.sin(theta)
z = r * np.cos(phi)
intensity = 1 - rs
fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(111, projection='3d')
sc = ax.scatter(x, y, z, c=intensity, cmap='hot', s=2, alpha=0.8)
ax.set_title("3D Simulated Fireball")
ax.set_xlabel("X")
ax.set_ylabel("Y")
ax.set_zlabel("Z")
ax.set_box_aspect([1, 1, 1])
plt.tight_layout()
plt.show()
#source code --> clcoding.com
Code Explanation:

.png)
.png)
.png)

.png)
.png)

.png)

.png)
.png)
.png)
.png)
.png)


.png)
.png)
