Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def analyze_divisible_angles():
- """
- Analyzes angles divisible by 3 up to 90°, comparing a custom pattern
- to trigonometric functions (cosine, sine, tangent).
- """
- print("# Analysis of Angles and Trigonometric Patterns")
- print("\nAngle | Third | Pattern | cos(θ) | sin(θ) | tan(θ) | Diff (cos) | Diff (sin) | Diff (tan)")
- print("------|-------|---------|--------|--------|--------|------------|------------|------------")
- bool_div = -1 # Initialize pattern multiplier
- for angle in range(1, 91, 1):
- third = angle / 3 # Exact third of the angle
- angle_rad = math.radians(angle)
- # Trigonometric functions
- cos_val = math.cos(angle_rad)
- sin_val = math.sin(angle_rad)
- tan_val = math.tan(angle_rad) if angle != 90 else float('inf') # Avoid infinity at 90°
- # Compute pattern
- x_recip = 1 / (angle if angle != 0 else 1) # Reciprocal of angle
- max_val = max(angle, x_recip)
- min_val = min(angle, x_recip)
- pattern = math.radians(-1 * (max_val - min_val - max_val))
- # Toggle `bool_div` every 3rd angle
- if angle % 3 == 0:
- bool_div *= 1
- # Compute differences
- diff_cos = abs(pattern - cos_val)
- diff_sin = (abs(pattern / angle)) # if sin_val != 0 else (abs(pattern - (1 / sin_val)))
- diff_tan = abs(pattern)**2/3
- # print(f"{angle:3d}° | {third:5.1f}° | {pattern:8.4f} | {cos_val:6.4f} | {sin_val:6.4f} | {tan_val:6.4f} | {diff_cos:10.6f} | {diff_sin:10.6f} | {diff_tan:10.6f}")
- # Highlight small differences
- if diff_cos < 0.1 or diff_sin < 0.1 or diff_tan < 0.1:
- print(f"\n🔹 Significant match at {angle}°:")
- print(f" - Pattern: {pattern:.6f}")
- print(f" - cos(θ): {cos_val:.6f}, sin(θ): {sin_val:.6f}, tan(θ): {tan_val:.6f}")
- print(f" - Diff (cos): {diff_cos:.6f}, Diff (sin): {diff_sin:.6f}, Diff (tan): {diff_tan:.6f}")
- print("---")
- # Run the function
- analyze_divisible_angles()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement