Я хочу нарисовать форму фюзеляжа Boeing 747 с помощью Python. Я начал немного, но я не могу сделать это отлично. Br /> и это то, что я сделал до сих пор: < /p>
import numpy as np
import matplotlib.pyplot as plt
def Fuselage_Boeing(a, total_height):
height1 = 0.75 * total_height
height2 = 0.25 * total_height
b = height1 / 2
d = height2 / 2
c = a / 4
overlap = 1.75 * d
offset_y = height1 - d - overlap
t1 = np.linspace(0, 360, 1000)
x1 = (a / 2) * np.cos(np.radians(t1))
y1 = b * np.sin(np.radians(t1))
t2 = np.linspace(0, 360, 1000)
x2 = c * np.cos(np.radians(t2))
y2 = d * np.sin(np.radians(t2)) + offset_y
def is_inside_ellipse(x, y, h, k, A, B):
"""Check if a point (x, y) is inside an ellipse centered at (h, k) with axes A and B."""
return ((x - h) ** 2) / (A ** 2) + ((y - k) ** 2) / (B ** 2)
output:
output < /p>
чего я ожидаю:
ожидание < /p>
Подробнее здесь: https://stackoverflow.com/questions/793 ... ing-python