-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconic_section_velocity_fullscreen.html
126 lines (104 loc) · 5.17 KB
/
conic_section_velocity_fullscreen.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Astrodynamics</title>
<link rel="stylesheet" type="text/css" href="css/astro_d3.css"/>
<script type="text/javascript" src="lib/d3.js"></script>
<script type="text/javascript" src="astro.js"></script>
<script type="text/javascript" src="js/astro_d3_utility.js"></script>
</head>
<body>
<div id="graphs" style="float: left;">
<div id="conic_section_velocity_components_orbit" style="float: left;"></div>
<div id="conic_section_velocity_components_hodograph" style="float: left;"></div>
<div id="conic_section_velocity_components_lines" style="float: left; clear: both;"></div>
<div id="conic_section_velocity_components_controls" style="float: right;"></div>
</div>
<script type="text/javascript" src="js/conic_section_model.js"></script>
<script type="text/javascript" src="js/conic_section_inputoutput.js"></script>
<script type="text/javascript" src="js/conic_section_orbit.js"></script>
<script type="text/javascript" src="js/conic_section_hodograph.js"></script>
<script type="text/javascript" src="js/conic_section_lines.js"></script>
<script type="text/javascript">
model.init();
function updateGraphs() {
d3.select("#conic_section_velocity_components_orbit").datum(model).call(orbitChart);
d3.select("#conic_section_velocity_components_hodograph").datum(model).call(hodographChart);
d3.select("#conic_section_velocity_components_lines").datum(model.twoBodyData).call(lineChart);
d3.select("#conic_section_flightpathangle").datum(model.twoBodyData).call(lineChart2);
}
var orbitControls = conicSectionInputOutput()
.graphSetPrefix("conic_section_velocity_components")
.sliders(
[{ label: "Semi latus rectum",
property: "semiLatusRectum",
prefix: "<i>p</i> = ",
multiplier: 1,
units: " km",
min: 100,
max: 40000,
step: 200,
digits: 0 },
{ label: "Eccentricity",
property: "eccentricity",
prefix: "<i>e</i> = ",
multiplier: 1,
units: "",
min: 0,
max: 2,
step: 0.01,
digits: 2 },
/*
{ label: "Argument of perigee",
property: "argumentOfPerigee",
prefix: "<i>φ</i> = ",
multiplier: 180 / Math.PI,
units: "°",
min: 0,
max: 360,
step: 1,
digits: 1 },
*/
{ label: "True anomaly",
property: "trueAnomaly",
prefix: "<i>θ</i> = ",
multiplier: 180 / Math.PI,
units: "°",
min: -180,
max: 180,
step: 1,
digits: 1 }]
);
d3.select("#conic_section_velocity_components_controls").datum(model).call(orbitControls);
var orbitChart = conicSectionOrbit()
.showSemiLatusRectum(false)
.showArgumentOfPerigee(false)
.showVelocity(true)
.showNormalRadialVelocity(true)
.showHodographCircle(true)
.showFlightPathAngle(true)
.canvasWidth(600)
.canvasHeight(400)
.velocityScale(150/16);
var hodographChart = conicSectionHodograph()
.canvasWidth(350)
.canvasHeight(300);
var lineChart = conicSectionLines()
.canvasWidth(600)
.canvasHeight(400)
.ranges( { xmin: -180, xmax: +180, ymin: -15, ymax: +15 } );
var lineChart2 = conicSectionLines()
.canvasWidth(300)
.canvasHeight(300)
.plotVariables([{xAxisVariable: "trueAnomaly",
xAxisScaleFactor: 180/Math.PI,
yAxisVariable: "flightPathAngle",
yAxisScaleFactor: 180/Math.PI}])
.yAxisLabel("Flight path angle (deg)")
.ranges( { xmin: -180, xmax: +180, ymin: -90, ymax: +90 } )
.yTickValues([-90,-60,-30,30,60,90]);
updateGraphs();
</script>
</body>
</html>