refactor: 重命名变量以提高代码可读性
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { TrackingReferenceFrame, type Viewer } from 'cesium';
|
|
||||||
import * as Cesium from 'cesium';
|
import * as Cesium from 'cesium';
|
||||||
|
import { type Viewer } from 'cesium';
|
||||||
import { eciToEcf, gstime, propagate, twoline2satrec } from 'satellite.js';
|
import { eciToEcf, gstime, propagate, twoline2satrec } from 'satellite.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,10 +123,10 @@ export async function demo_02_Track(viewer: Viewer) {
|
|||||||
// Starlink 卫星通常覆盖范围以锥形方式向地面投射
|
// Starlink 卫星通常覆盖范围以锥形方式向地面投射
|
||||||
// 创建一个椭球体来表示卫星的覆盖范围
|
// 创建一个椭球体来表示卫星的覆盖范围
|
||||||
const coverageAngle = 45; // 覆盖角度(度)
|
const coverageAngle = 45; // 覆盖角度(度)
|
||||||
const coverageRadius = satelliteAltitude * Math.tan(Cesium.Math.toRadians(coverageAngle));
|
const _coverageRadius = satelliteAltitude * Math.tan(Cesium.Math.toRadians(coverageAngle));
|
||||||
|
|
||||||
// 创建覆盖范围实体
|
// 创建覆盖范围实体
|
||||||
const coverageEntity = viewer.entities.add({
|
const _coverageEntity = viewer.entities.add({
|
||||||
ellipsoid: {
|
ellipsoid: {
|
||||||
material: Cesium.Color.BLUE.withAlpha(0.2),
|
material: Cesium.Color.BLUE.withAlpha(0.2),
|
||||||
outline: true,
|
outline: true,
|
||||||
@ -156,7 +156,7 @@ export async function demo_02_Track(viewer: Viewer) {
|
|||||||
if (!position) return Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3());
|
if (!position) return Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3());
|
||||||
|
|
||||||
// 计算从卫星到地球中心的方向
|
// 计算从卫星到地球中心的方向
|
||||||
const direction = Cesium.Cartesian3.normalize(
|
const _direction = Cesium.Cartesian3.normalize(
|
||||||
Cesium.Cartesian3.negate(position, new Cesium.Cartesian3()),
|
Cesium.Cartesian3.negate(position, new Cesium.Cartesian3()),
|
||||||
new Cesium.Cartesian3(),
|
new Cesium.Cartesian3(),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user