-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path3D_Scatter_Plot.py
More file actions
37 lines (29 loc) · 850 Bytes
/
3D_Scatter_Plot.py
File metadata and controls
37 lines (29 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import plotly.express as px
import sympy as sp
from mpl_toolkits.mplot3d import Axes3D
# Define the triangle sides and angles
a, b, c = sp.symbols('a b c')
A, B, C = sp.symbols('A B C')
# Define the Law of Sines formula
law_of_sines = [a/sp.sin(A) - b/sp.sin(B), b/sp.sin(B) - c/sp.sin(C), c/sp.sin(C) - a/sp.sin(A)]
# Solve the equations
solution = sp.solve(law_of_sines, (a, b, c))
# Create a 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Define data points
x = np.random.rand(10)
y = np.random.rand(10)
z = np.random.rand(10)
# Plot the data points
ax.scatter(x, y, z, c='r', marker='o')
# Add labels and title
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.title('3D Scatter Plot')
# Show the plot
plt.show()