import math
import matplotlib.pyplot as plt
#Get y value for x value of circle of radius R.
def getY(x, R) :
return(math.sqrt(R**2 - x**2))
def plotXiddler(A, B, C, R, details, scenario):
minR = -1*R - 0.1
maxR = R + 0.1
fig = plt.figure(figsize = (9, 9))
ax = fig.add_subplot(111, xlim = (minR, maxR), ylim = (minR, maxR))
#Remove axes and ticks.
for side in ['bottom', 'left', 'top', 'right']:
ax.spines[side].set_visible(False)
ax.set_xticks([])
ax.set_yticks([])
#Planet.
xiddler = plt.Circle((0,0), R, color = "#EEEEEE")
ax.add_patch(xiddler)
#Cross Section A
yA = getY(A, R)
ax.plot((-1*A, A), (yA, yA),
c = '#482677',
ls = '-',
lw = 3)
#Cross Section B
yB = getY(B, R)
ax.plot((-1*B, B), (yB, yB),
c = '#287D8E',
ls = '-',
lw = 3)
#Cross Section C
if scenario == 3 :
m = -1
else :
m = 1
yC = m*getY(C, R)
ax.plot((-1*C, C), (yC, yC),
c = '#55C667',
ls = '-',
lw = 3)
label = ""
if details:
#Center
ax.scatter((0), (0), c = 'k', lw = 3, zorder = 2)
#A,B,C
variables = [("A", (A/2, yA), '#482677', 'center', 'bottom'),
("B", (B/2, yB), '#287D8E', 'center', 'bottom'),
("C", (C/2, yC), '#287D8E', 'center', 'bottom')]
#Height.
yh = 0
if scenario == 3:
yh = yC
ax.plot((0, 0), (yh, yA), c = 'k', ls = ':', lw = 2)
variables.append(("d", (-1*R/12, (yA + yB) / 2), 'k', 'center', 'center'))
variables.append(("d", (-1*R/12, (yB + yC) / 2), 'k', 'center', 'center'))
#As Radius.
ax.plot((0, A), (0, yA), c = 'k', ls = ':', lw = 2)
variables.append(("R", (A/2, + yA/2), 'k', 'left', 'top'))
#Bs Radius.
ax.plot((0, B), (0, yB), c = 'k', ls = ':', lw = 2)
variables.append(("R", (B/2, + yB/2), 'k', 'left', 'top'))
if scenario != 2:
#Cs Radius.
ax.plot((0, C), (0, yC), c = 'k', ls = ':', lw = 2)
variables.append(("R", (C/2, + yC/2), 'k', 'left', 'top'))
#All labels.
for v in variables:
plt.annotate(v[0], v[1], c = v[2],
fontsize = 16,
fontweight = "bold",
ha = v[3],
va = v[4])
label = "L"
fig.savefig("2022.03.25 Classic" + str(scenario) + label + ".png")
for R in range(4, 25) :
for C in range(3, R):
for B in range(2, C):
for A in range(1, B) :
h1 = math.sqrt(R**2 - C**2)
h2 = math.sqrt(R**2 - B**2)
h3 = math.sqrt(R**2 - A**2)
if (round(h3 - h2, 3) == round(h2 - h1, 3)):
print(A, B, C, R)
7 11 13 14 2 9 12 16 4 11 14 16 6 11 14 21 4 7 9 24 17 20 22 24
plotXiddler(7, 11, 13, 14, False, 1)
plotXiddler(7, 11, 13, 14, True, 1)
for R in range(4, 25) :
for C in range(R, R+1):
for B in range(2, C):
for A in range(1, B) :
h1 = math.sqrt(R**2 - C**2)
h2 = math.sqrt(R**2 - B**2)
h3 = math.sqrt(R**2 - A**2)
if (round(h3 - h2, 3) == round(h2 - h1, 3)):
print(A, B, C, R)
2 7 8 8 1 13 15 15 4 14 16 16 11 19 21 21 6 21 24 24
plotXiddler(2, 7, 8, 8, False, 2)
plotXiddler(2, 7, 8, 8, True, 2)
for R in range(4, 110) :
for C in range(3, R):
for B in range(2, C):
for A in range(1, B) :
h1 = math.sqrt(R**2 - C**2)
h2 = math.sqrt(R**2 - B**2)
h3 = math.sqrt(R**2 - A**2)
if (round(h3 - h2, 3) == round(h2 + h1, 3)):
print(A, B, C, R)
18 58 62 63 24 70 73 75 30 89 92 95 44 96 97 101 20 100 103 107
plotXiddler(18, 58, 62, 63, False, 3)
plotXiddler(18, 58, 62, 63, True, 3)
for R in range(4, 70) :
for C in range(3, R):
for B in range(2, C):
for A in range(1, B) :
h1 = math.sqrt(R**2 - C**2)
h2 = math.sqrt(R**2 - B**2)
h3 = math.sqrt(R**2 - A**2)
if (round(h3 - h1, 3) == round(h2 + h1, 3)):
print(A, B, C, R)
5 30 34 35 17 47 49 51 17 50 53 55 42 58 62 63 17 53 67 68