Advertisement
UF6

Entailment Cone Structure

UF6
Oct 19th, 2024
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.69 KB | Source Code | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from mpl_toolkits.mplot3d import Axes3D
  4.  
  5. # Create the figure and a 3D axis
  6. fig = plt.figure()
  7. ax = fig.add_subplot(111, projection='3d')
  8.  
  9. # Define points at different levels of the cone
  10. base = [0, 0, 0]  # Base axiom
  11. level_1 = [[1, 0, 1], [-1, 0, 1]]  # First set of derived statements
  12. level_2 = [[2, 1, 2], [-2, 1, 2], [1.5, -1, 2], [-1.5, -1, 2]]  # Next derivations
  13.  
  14. # Function to generate points in a circular (conical) pattern
  15. def generate_cone_points(level, num_points, radius):
  16.     # Z-coordinate is fixed to the level number (height)
  17.     z = level  
  18.     points = []
  19.     # Angle between points (in radians) to distribute them evenly in a circle
  20.     angle_increment = 2 * np.pi / num_points
  21.     for i in range(num_points):
  22.         angle = i * angle_increment
  23.         x = radius * np.cos(angle)
  24.         y = radius * np.sin(angle)
  25.         points.append([x, y, z])
  26.     return points
  27.  
  28. # Generate points for level 3 and onward with conical spread
  29. level_3 = generate_cone_points(3, 6, 3)  # 6 points at level 3 with radius 3
  30. level_4 = generate_cone_points(4, 8, 4)  # 8 points at level 4 with radius 4
  31. level_5= generate_cone_points(5, 10, 5)  # 10 points at level 5 with radius 5
  32. # Plot the base
  33. ax.scatter(base[0], base[1], base[2], c='red', s=100, label='Axiom')
  34.  
  35. # Plot level 1 points
  36. for point in level_1:
  37.     ax.scatter(point[0], point[1], point[2], c='blue', s=60)
  38.     ax.plot([base[0], point[0]], [base[1], point[1]], [base[2], point[2]], color='black')
  39.  
  40. # Plot level 2 points
  41. for point in level_2:
  42.     ax.scatter(point[0], point[1], point[2], c='green', s=60)
  43.     for l1_point in level_1:
  44.         ax.plot([l1_point[0], point[0]], [l1_point[1], point[1]], [l1_point[2], point[2]], color='black')
  45.  
  46. # Plot level 3 points (cone pattern)
  47. for point in level_3:
  48.     ax.scatter(point[0], point[1], point[2], c='orange', s=60)
  49.     for l2_point in level_2:
  50.         ax.plot([l2_point[0], point[0]], [l2_point[1], point[1]], [l2_point[2], point[2]], color='black')
  51.  
  52. # Plot level 4 points (cone pattern)
  53. for point in level_4:
  54.     ax.scatter(point[0], point[1], point[2], c='purple', s=60)
  55.     for l3_point in level_3:
  56.         ax.plot([l3_point[0], point[0]], [l3_point[1], point[1]], [l3_point[2], point[2]], color='black')
  57.        
  58. # Plot level 5 points (cone pattern)
  59. for point in level_5:
  60.     ax.scatter(point[0], point[1], point[2], c='yellow', s=60)
  61.     for l4_point in level_4:
  62.         ax.plot([l4_point[0], point[0]], [l4_point[1], point[1]], [l4_point[2], point[2]], color='black')
  63.  
  64. # Labels and legend
  65. ax.set_title('Entailment Cone')
  66. ax.set_xlabel('X Axis')
  67. ax.set_ylabel('Y Axis')
  68. ax.set_zlabel('Z Axis')
  69. plt.legend()
  70. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement