当前位置: 首页> 科技> 数码 > 网络服务主要包括哪几项_如何设公司产品购物网站_产品推广方式及推广计划_搜索率最高的关键词

网络服务主要包括哪几项_如何设公司产品购物网站_产品推广方式及推广计划_搜索率最高的关键词

时间:2025/8/9 3:23:33来源:https://blog.csdn.net/qq_52964132/article/details/145713590 浏览次数:0次
网络服务主要包括哪几项_如何设公司产品购物网站_产品推广方式及推广计划_搜索率最高的关键词

在这里插入图片描述


import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from mpl_toolkits.mplot3d import Axes3D# 天体参数设置(简化模型)
AU = 1.5e8  # 天文单位(公里)
earth_orbital_radius = 1.0 * AU
mars_orbital_radius = 1.5 * AU
orbital_speed = 2e4  # 简化轨道速度(km/s)# 时间参数
earth_period = 365  # 天
mars_period = 687  # 天
transfer_time = 258  # 霍曼转移时间(天)
time_step = 2  # 动画时间步长(天)
total_duration = 800  # 总任务时间(天)# 初始化图形
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, projection='3d')
ax.set_facecolor('black')# 天体初始位置
def celestial_pos(t, period, radius):angle = 2 * np.pi * t / periodreturn radius * np.array([np.cos(angle), np.sin(angle), 0])# 霍曼转移轨道计算
def transfer_orbit(t, t_start, radius_from, radius_to, transfer_time):angle = np.pi * (t - t_start) / transfer_timer = radius_from + (radius_to - radius_from) * (t - t_start) / transfer_timereturn r * np.array([np.cos(angle), np.sin(angle), 0])# 初始化绘图元素
earth, = ax.plot([], [], [], 'o', color='blue', markersize=8)
mars, = ax.plot([], [], [], 'o', color='red', markersize=6)
ship, = ax.plot([], [], [], 'o', color='white', markersize=4)
trajectory, = ax.plot([], [], [], '-', color='gray', alpha=0.5)
sun = ax.plot([0], [0], [0], 'o', color='yellow', markersize=12)[0]# 坐标轴设置
max_orbit = mars_orbital_radius * 1.2
ax.set_xlim(-max_orbit, max_orbit)
ax.set_ylim(-max_orbit, max_orbit)
ax.set_zlim(-max_orbit / 10, max_orbit / 10)
ax.axis('off')# 动画更新函数
def update(frame):t = frame * time_step# 更新天体位置earth_pos = celestial_pos(t, earth_period, earth_orbital_radius)earth.set_data(earth_pos[0], earth_pos[1])earth.set_3d_properties(0)mars_pos = celestial_pos(t, mars_period, mars_orbital_radius)mars.set_data(mars_pos[0], mars_pos[1])mars.set_3d_properties(0)# 飞船状态机if t < transfer_time:  # 前往火星阶段ship_pos = transfer_orbit(t, 0, earth_orbital_radius, mars_orbital_radius, transfer_time)elif t < transfer_time + 30:  # 火星停留ship_pos = mars_poselse:  # 返回地球阶段ship_pos = transfer_orbit(t - transfer_time - 30, 0, mars_orbital_radius, earth_orbital_radius, transfer_time)ship.set_data(ship_pos[0], ship_pos[1])ship.set_3d_properties(0)# 更新轨迹x, y, z = trajectory.get_data_3d()x = np.append(x, ship_pos[0])y = np.append(y, ship_pos[1])z = np.append(z, 0)trajectory.set_data(x, y)trajectory.set_3d_properties(z)return earth, mars, ship, trajectory, sun# 创建动画
ani = FuncAnimation(fig, update, frames=int(total_duration / time_step),interval=50, blit=True)# 添加图例和标注
ax.text(0, 0, 0, "SUN", color='yellow', ha='center')
ax.text(earth_orbital_radius, 0, 0, "Earth", color='blue')
ax.text(mars_orbital_radius, 0, 0, "Mars", color='red')plt.show()
关键字:网络服务主要包括哪几项_如何设公司产品购物网站_产品推广方式及推广计划_搜索率最高的关键词

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: