-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjet.js
57 lines (49 loc) · 17.5 KB
/
jet.js
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
var jet = [[0.000, [0.000, 0.000, 0.500]], [0.002, [0.000, 0.000, 0.500]], [0.004, [0.000, 0.000, 0.518]], [0.006, [0.000, 0.000, 0.518]], [0.008, [0.000, 0.000, 0.536]], [0.010, [0.000, 0.000, 0.536]], [0.012, [0.000, 0.000, 0.553]], [0.014, [0.000, 0.000, 0.553]], [0.016, [0.000, 0.000, 0.571]], [0.018, [0.000, 0.000, 0.571]], [0.020, [0.000, 0.000, 0.589]], [0.022, [0.000, 0.000, 0.589]], [0.023, [0.000, 0.000, 0.607]], [0.025, [0.000, 0.000, 0.607]], [0.027, [0.000, 0.000, 0.625]], [0.029, [0.000, 0.000, 0.625]], [0.031, [0.000, 0.000, 0.643]], [0.033, [0.000, 0.000, 0.643]], [0.035, [0.000, 0.000, 0.660]], [0.037, [0.000, 0.000, 0.660]], [0.039, [0.000, 0.000, 0.678]], [0.041, [0.000, 0.000, 0.678]], [0.043, [0.000, 0.000, 0.696]], [0.045, [0.000, 0.000, 0.696]], [0.047, [0.000, 0.000, 0.714]], [0.049, [0.000, 0.000, 0.714]], [0.051, [0.000, 0.000, 0.732]], [0.053, [0.000, 0.000, 0.732]], [0.055, [0.000, 0.000, 0.750]], [0.057, [0.000, 0.000, 0.750]], [0.059, [0.000, 0.000, 0.767]], [0.061, [0.000, 0.000, 0.767]], [0.063, [0.000, 0.000, 0.785]], [0.065, [0.000, 0.000, 0.785]], [0.067, [0.000, 0.000, 0.803]], [0.068, [0.000, 0.000, 0.803]], [0.070, [0.000, 0.000, 0.821]], [0.072, [0.000, 0.000, 0.821]], [0.074, [0.000, 0.000, 0.839]], [0.076, [0.000, 0.000, 0.839]], [0.078, [0.000, 0.000, 0.857]], [0.080, [0.000, 0.000, 0.857]], [0.082, [0.000, 0.000, 0.874]], [0.084, [0.000, 0.000, 0.874]], [0.086, [0.000, 0.000, 0.892]], [0.088, [0.000, 0.000, 0.892]], [0.090, [0.000, 0.000, 0.910]], [0.092, [0.000, 0.000, 0.910]], [0.094, [0.000, 0.000, 0.928]], [0.096, [0.000, 0.000, 0.928]], [0.098, [0.000, 0.000, 0.946]], [0.100, [0.000, 0.000, 0.946]], [0.102, [0.000, 0.000, 0.963]], [0.104, [0.000, 0.000, 0.963]], [0.106, [0.000, 0.000, 0.981]], [0.108, [0.000, 0.000, 0.981]], [0.110, [0.000, 0.000, 0.999]], [0.112, [0.000, 0.000, 0.999]], [0.114, [0.000, 0.000, 1.000]], [0.115, [0.000, 0.000, 1.000]], [0.117, [0.000, 0.000, 1.000]], [0.119, [0.000, 0.000, 1.000]], [0.121, [0.000, 0.000, 1.000]], [0.123, [0.000, 0.000, 1.000]], [0.125, [0.000, 0.002, 1.000]], [0.127, [0.000, 0.002, 1.000]], [0.129, [0.000, 0.018, 1.000]], [0.131, [0.000, 0.018, 1.000]], [0.133, [0.000, 0.033, 1.000]], [0.135, [0.000, 0.033, 1.000]], [0.137, [0.000, 0.049, 1.000]], [0.139, [0.000, 0.049, 1.000]], [0.141, [0.000, 0.065, 1.000]], [0.143, [0.000, 0.065, 1.000]], [0.145, [0.000, 0.080, 1.000]], [0.147, [0.000, 0.080, 1.000]], [0.149, [0.000, 0.096, 1.000]], [0.151, [0.000, 0.096, 1.000]], [0.153, [0.000, 0.112, 1.000]], [0.155, [0.000, 0.112, 1.000]], [0.157, [0.000, 0.127, 1.000]], [0.159, [0.000, 0.127, 1.000]], [0.160, [0.000, 0.143, 1.000]], [0.162, [0.000, 0.143, 1.000]], [0.164, [0.000, 0.159, 1.000]], [0.166, [0.000, 0.159, 1.000]], [0.168, [0.000, 0.175, 1.000]], [0.170, [0.000, 0.175, 1.000]], [0.172, [0.000, 0.190, 1.000]], [0.174, [0.000, 0.190, 1.000]], [0.176, [0.000, 0.206, 1.000]], [0.178, [0.000, 0.206, 1.000]], [0.180, [0.000, 0.222, 1.000]], [0.182, [0.000, 0.222, 1.000]], [0.184, [0.000, 0.237, 1.000]], [0.186, [0.000, 0.237, 1.000]], [0.188, [0.000, 0.253, 1.000]], [0.190, [0.000, 0.253, 1.000]], [0.192, [0.000, 0.269, 1.000]], [0.194, [0.000, 0.269, 1.000]], [0.196, [0.000, 0.284, 1.000]], [0.198, [0.000, 0.284, 1.000]], [0.200, [0.000, 0.300, 1.000]], [0.202, [0.000, 0.300, 1.000]], [0.204, [0.000, 0.316, 1.000]], [0.205, [0.000, 0.316, 1.000]], [0.207, [0.000, 0.331, 1.000]], [0.209, [0.000, 0.331, 1.000]], [0.211, [0.000, 0.347, 1.000]], [0.213, [0.000, 0.347, 1.000]], [0.215, [0.000, 0.363, 1.000]], [0.217, [0.000, 0.363, 1.000]], [0.219, [0.000, 0.378, 1.000]], [0.221, [0.000, 0.378, 1.000]], [0.223, [0.000, 0.394, 1.000]], [0.225, [0.000, 0.394, 1.000]], [0.227, [0.000, 0.410, 1.000]], [0.229, [0.000, 0.410, 1.000]], [0.231, [0.000, 0.425, 1.000]], [0.233, [0.000, 0.425, 1.000]], [0.235, [0.000, 0.441, 1.000]], [0.237, [0.000, 0.441, 1.000]], [0.239, [0.000, 0.457, 1.000]], [0.241, [0.000, 0.457, 1.000]], [0.243, [0.000, 0.473, 1.000]], [0.245, [0.000, 0.473, 1.000]], [0.247, [0.000, 0.488, 1.000]], [0.249, [0.000, 0.488, 1.000]], [0.250, [0.000, 0.504, 1.000]], [0.252, [0.000, 0.504, 1.000]], [0.254, [0.000, 0.520, 1.000]], [0.256, [0.000, 0.520, 1.000]], [0.258, [0.000, 0.535, 1.000]], [0.260, [0.000, 0.535, 1.000]], [0.262, [0.000, 0.551, 1.000]], [0.264, [0.000, 0.551, 1.000]], [0.266, [0.000, 0.567, 1.000]], [0.268, [0.000, 0.567, 1.000]], [0.270, [0.000, 0.582, 1.000]], [0.272, [0.000, 0.582, 1.000]], [0.274, [0.000, 0.598, 1.000]], [0.276, [0.000, 0.598, 1.000]], [0.278, [0.000, 0.614, 1.000]], [0.280, [0.000, 0.614, 1.000]], [0.282, [0.000, 0.629, 1.000]], [0.284, [0.000, 0.629, 1.000]], [0.286, [0.000, 0.645, 1.000]], [0.288, [0.000, 0.645, 1.000]], [0.290, [0.000, 0.661, 1.000]], [0.292, [0.000, 0.661, 1.000]], [0.294, [0.000, 0.676, 1.000]], [0.295, [0.000, 0.676, 1.000]], [0.297, [0.000, 0.692, 1.000]], [0.299, [0.000, 0.692, 1.000]], [0.301, [0.000, 0.708, 1.000]], [0.303, [0.000, 0.708, 1.000]], [0.305, [0.000, 0.724, 1.000]], [0.307, [0.000, 0.724, 1.000]], [0.309, [0.000, 0.739, 1.000]], [0.311, [0.000, 0.739, 1.000]], [0.313, [0.000, 0.755, 1.000]], [0.315, [0.000, 0.755, 1.000]], [0.317, [0.000, 0.771, 1.000]], [0.319, [0.000, 0.771, 1.000]], [0.321, [0.000, 0.786, 1.000]], [0.323, [0.000, 0.786, 1.000]], [0.325, [0.000, 0.802, 1.000]], [0.327, [0.000, 0.802, 1.000]], [0.329, [0.000, 0.818, 1.000]], [0.331, [0.000, 0.818, 1.000]], [0.333, [0.000, 0.833, 1.000]], [0.335, [0.000, 0.833, 1.000]], [0.337, [0.000, 0.849, 1.000]], [0.339, [0.000, 0.849, 1.000]], [0.341, [0.000, 0.865, 0.996]], [0.342, [0.000, 0.865, 0.996]], [0.344, [0.000, 0.880, 0.984]], [0.346, [0.000, 0.880, 0.984]], [0.348, [0.000, 0.896, 0.971]], [0.350, [0.000, 0.896, 0.971]], [0.352, [0.009, 0.912, 0.958]], [0.354, [0.009, 0.912, 0.958]], [0.356, [0.022, 0.927, 0.946]], [0.358, [0.022, 0.927, 0.946]], [0.360, [0.035, 0.943, 0.933]], [0.362, [0.035, 0.943, 0.933]], [0.364, [0.047, 0.959, 0.920]], [0.366, [0.047, 0.959, 0.920]], [0.368, [0.060, 0.975, 0.908]], [0.370, [0.060, 0.975, 0.908]], [0.372, [0.073, 0.990, 0.895]], [0.374, [0.073, 0.990, 0.895]], [0.376, [0.085, 1.000, 0.882]], [0.378, [0.085, 1.000, 0.882]], [0.380, [0.098, 1.000, 0.870]], [0.382, [0.098, 1.000, 0.870]], [0.384, [0.111, 1.000, 0.857]], [0.386, [0.111, 1.000, 0.857]], [0.387, [0.123, 1.000, 0.844]], [0.389, [0.123, 1.000, 0.844]], [0.391, [0.136, 1.000, 0.832]], [0.393, [0.136, 1.000, 0.832]], [0.395, [0.149, 1.000, 0.819]], [0.397, [0.149, 1.000, 0.819]], [0.399, [0.161, 1.000, 0.806]], [0.401, [0.161, 1.000, 0.806]], [0.403, [0.174, 1.000, 0.794]], [0.405, [0.174, 1.000, 0.794]], [0.407, [0.187, 1.000, 0.781]], [0.409, [0.187, 1.000, 0.781]], [0.411, [0.199, 1.000, 0.769]], [0.413, [0.199, 1.000, 0.769]], [0.415, [0.212, 1.000, 0.756]], [0.417, [0.212, 1.000, 0.756]], [0.419, [0.225, 1.000, 0.743]], [0.421, [0.225, 1.000, 0.743]], [0.423, [0.237, 1.000, 0.731]], [0.425, [0.237, 1.000, 0.731]], [0.427, [0.250, 1.000, 0.718]], [0.429, [0.250, 1.000, 0.718]], [0.431, [0.262, 1.000, 0.705]], [0.432, [0.262, 1.000, 0.705]], [0.434, [0.275, 1.000, 0.693]], [0.436, [0.275, 1.000, 0.693]], [0.438, [0.288, 1.000, 0.680]], [0.440, [0.288, 1.000, 0.680]], [0.442, [0.300, 1.000, 0.667]], [0.444, [0.300, 1.000, 0.667]], [0.446, [0.313, 1.000, 0.655]], [0.448, [0.313, 1.000, 0.655]], [0.450, [0.326, 1.000, 0.642]], [0.452, [0.326, 1.000, 0.642]], [0.454, [0.338, 1.000, 0.629]], [0.456, [0.338, 1.000, 0.629]], [0.458, [0.351, 1.000, 0.617]], [0.460, [0.351, 1.000, 0.617]], [0.462, [0.364, 1.000, 0.604]], [0.464, [0.364, 1.000, 0.604]], [0.466, [0.376, 1.000, 0.591]], [0.468, [0.376, 1.000, 0.591]], [0.470, [0.389, 1.000, 0.579]], [0.472, [0.389, 1.000, 0.579]], [0.474, [0.402, 1.000, 0.566]], [0.476, [0.402, 1.000, 0.566]], [0.477, [0.414, 1.000, 0.553]], [0.479, [0.414, 1.000, 0.553]], [0.481, [0.427, 1.000, 0.541]], [0.483, [0.427, 1.000, 0.541]], [0.485, [0.440, 1.000, 0.528]], [0.487, [0.440, 1.000, 0.528]], [0.489, [0.452, 1.000, 0.515]], [0.491, [0.452, 1.000, 0.515]], [0.493, [0.465, 1.000, 0.503]], [0.495, [0.465, 1.000, 0.503]], [0.497, [0.478, 1.000, 0.490]], [0.499, [0.478, 1.000, 0.490]], [0.501, [0.490, 1.000, 0.478]], [0.503, [0.490, 1.000, 0.478]], [0.505, [0.503, 1.000, 0.465]], [0.507, [0.503, 1.000, 0.465]], [0.509, [0.515, 1.000, 0.452]], [0.511, [0.515, 1.000, 0.452]], [0.513, [0.528, 1.000, 0.440]], [0.515, [0.528, 1.000, 0.440]], [0.517, [0.541, 1.000, 0.427]], [0.519, [0.541, 1.000, 0.427]], [0.521, [0.553, 1.000, 0.414]], [0.523, [0.553, 1.000, 0.414]], [0.524, [0.566, 1.000, 0.402]], [0.526, [0.566, 1.000, 0.402]], [0.528, [0.579, 1.000, 0.389]], [0.530, [0.579, 1.000, 0.389]], [0.532, [0.591, 1.000, 0.376]], [0.534, [0.591, 1.000, 0.376]], [0.536, [0.604, 1.000, 0.364]], [0.538, [0.604, 1.000, 0.364]], [0.540, [0.617, 1.000, 0.351]], [0.542, [0.617, 1.000, 0.351]], [0.544, [0.629, 1.000, 0.338]], [0.546, [0.629, 1.000, 0.338]], [0.548, [0.642, 1.000, 0.326]], [0.550, [0.642, 1.000, 0.326]], [0.552, [0.655, 1.000, 0.313]], [0.554, [0.655, 1.000, 0.313]], [0.556, [0.667, 1.000, 0.300]], [0.558, [0.667, 1.000, 0.300]], [0.560, [0.680, 1.000, 0.288]], [0.562, [0.680, 1.000, 0.288]], [0.564, [0.693, 1.000, 0.275]], [0.566, [0.693, 1.000, 0.275]], [0.568, [0.705, 1.000, 0.262]], [0.569, [0.705, 1.000, 0.262]], [0.571, [0.718, 1.000, 0.250]], [0.573, [0.718, 1.000, 0.250]], [0.575, [0.731, 1.000, 0.237]], [0.577, [0.731, 1.000, 0.237]], [0.579, [0.743, 1.000, 0.225]], [0.581, [0.743, 1.000, 0.225]], [0.583, [0.756, 1.000, 0.212]], [0.585, [0.756, 1.000, 0.212]], [0.587, [0.769, 1.000, 0.199]], [0.589, [0.769, 1.000, 0.199]], [0.591, [0.781, 1.000, 0.187]], [0.593, [0.781, 1.000, 0.187]], [0.595, [0.794, 1.000, 0.174]], [0.597, [0.794, 1.000, 0.174]], [0.599, [0.806, 1.000, 0.161]], [0.601, [0.806, 1.000, 0.161]], [0.603, [0.819, 1.000, 0.149]], [0.605, [0.819, 1.000, 0.149]], [0.607, [0.832, 1.000, 0.136]], [0.609, [0.832, 1.000, 0.136]], [0.611, [0.844, 1.000, 0.123]], [0.613, [0.844, 1.000, 0.123]], [0.614, [0.857, 1.000, 0.111]], [0.616, [0.857, 1.000, 0.111]], [0.618, [0.870, 1.000, 0.098]], [0.620, [0.870, 1.000, 0.098]], [0.622, [0.882, 1.000, 0.085]], [0.624, [0.882, 1.000, 0.085]], [0.626, [0.895, 1.000, 0.073]], [0.628, [0.895, 1.000, 0.073]], [0.630, [0.908, 1.000, 0.060]], [0.632, [0.908, 1.000, 0.060]], [0.634, [0.920, 1.000, 0.047]], [0.636, [0.920, 1.000, 0.047]], [0.638, [0.933, 1.000, 0.035]], [0.640, [0.933, 1.000, 0.035]], [0.642, [0.946, 0.988, 0.022]], [0.644, [0.946, 0.988, 0.022]], [0.646, [0.958, 0.974, 0.009]], [0.648, [0.958, 0.974, 0.009]], [0.650, [0.971, 0.959, 0.000]], [0.652, [0.971, 0.959, 0.000]], [0.654, [0.984, 0.945, 0.000]], [0.656, [0.984, 0.945, 0.000]], [0.658, [0.996, 0.930, 0.000]], [0.659, [0.996, 0.930, 0.000]], [0.661, [1.000, 0.916, 0.000]], [0.663, [1.000, 0.916, 0.000]], [0.665, [1.000, 0.901, 0.000]], [0.667, [1.000, 0.901, 0.000]], [0.669, [1.000, 0.887, 0.000]], [0.671, [1.000, 0.887, 0.000]], [0.673, [1.000, 0.872, 0.000]], [0.675, [1.000, 0.872, 0.000]], [0.677, [1.000, 0.858, 0.000]], [0.679, [1.000, 0.858, 0.000]], [0.681, [1.000, 0.843, 0.000]], [0.683, [1.000, 0.843, 0.000]], [0.685, [1.000, 0.829, 0.000]], [0.687, [1.000, 0.829, 0.000]], [0.689, [1.000, 0.814, 0.000]], [0.691, [1.000, 0.814, 0.000]], [0.693, [1.000, 0.800, 0.000]], [0.695, [1.000, 0.800, 0.000]], [0.697, [1.000, 0.785, 0.000]], [0.699, [1.000, 0.785, 0.000]], [0.701, [1.000, 0.771, 0.000]], [0.703, [1.000, 0.771, 0.000]], [0.705, [1.000, 0.756, 0.000]], [0.706, [1.000, 0.756, 0.000]], [0.708, [1.000, 0.741, 0.000]], [0.710, [1.000, 0.741, 0.000]], [0.712, [1.000, 0.727, 0.000]], [0.714, [1.000, 0.727, 0.000]], [0.716, [1.000, 0.712, 0.000]], [0.718, [1.000, 0.712, 0.000]], [0.720, [1.000, 0.698, 0.000]], [0.722, [1.000, 0.698, 0.000]], [0.724, [1.000, 0.683, 0.000]], [0.726, [1.000, 0.683, 0.000]], [0.728, [1.000, 0.669, 0.000]], [0.730, [1.000, 0.669, 0.000]], [0.732, [1.000, 0.654, 0.000]], [0.734, [1.000, 0.654, 0.000]], [0.736, [1.000, 0.640, 0.000]], [0.738, [1.000, 0.640, 0.000]], [0.740, [1.000, 0.625, 0.000]], [0.742, [1.000, 0.625, 0.000]], [0.744, [1.000, 0.611, 0.000]], [0.746, [1.000, 0.611, 0.000]], [0.748, [1.000, 0.596, 0.000]], [0.750, [1.000, 0.596, 0.000]], [0.751, [1.000, 0.582, 0.000]], [0.753, [1.000, 0.582, 0.000]], [0.755, [1.000, 0.567, 0.000]], [0.757, [1.000, 0.567, 0.000]], [0.759, [1.000, 0.553, 0.000]], [0.761, [1.000, 0.553, 0.000]], [0.763, [1.000, 0.538, 0.000]], [0.765, [1.000, 0.538, 0.000]], [0.767, [1.000, 0.524, 0.000]], [0.769, [1.000, 0.524, 0.000]], [0.771, [1.000, 0.509, 0.000]], [0.773, [1.000, 0.509, 0.000]], [0.775, [1.000, 0.495, 0.000]], [0.777, [1.000, 0.495, 0.000]], [0.779, [1.000, 0.480, 0.000]], [0.781, [1.000, 0.480, 0.000]], [0.783, [1.000, 0.466, 0.000]], [0.785, [1.000, 0.466, 0.000]], [0.787, [1.000, 0.451, 0.000]], [0.789, [1.000, 0.451, 0.000]], [0.791, [1.000, 0.436, 0.000]], [0.793, [1.000, 0.436, 0.000]], [0.795, [1.000, 0.422, 0.000]], [0.796, [1.000, 0.422, 0.000]], [0.798, [1.000, 0.407, 0.000]], [0.800, [1.000, 0.407, 0.000]], [0.802, [1.000, 0.393, 0.000]], [0.804, [1.000, 0.393, 0.000]], [0.806, [1.000, 0.378, 0.000]], [0.808, [1.000, 0.378, 0.000]], [0.810, [1.000, 0.364, 0.000]], [0.812, [1.000, 0.364, 0.000]], [0.814, [1.000, 0.349, 0.000]], [0.816, [1.000, 0.349, 0.000]], [0.818, [1.000, 0.335, 0.000]], [0.820, [1.000, 0.335, 0.000]], [0.822, [1.000, 0.320, 0.000]], [0.824, [1.000, 0.320, 0.000]], [0.826, [1.000, 0.306, 0.000]], [0.828, [1.000, 0.306, 0.000]], [0.830, [1.000, 0.291, 0.000]], [0.832, [1.000, 0.291, 0.000]], [0.834, [1.000, 0.277, 0.000]], [0.836, [1.000, 0.277, 0.000]], [0.838, [1.000, 0.262, 0.000]], [0.840, [1.000, 0.262, 0.000]], [0.841, [1.000, 0.248, 0.000]], [0.843, [1.000, 0.248, 0.000]], [0.845, [1.000, 0.233, 0.000]], [0.847, [1.000, 0.233, 0.000]], [0.849, [1.000, 0.219, 0.000]], [0.851, [1.000, 0.219, 0.000]], [0.853, [1.000, 0.204, 0.000]], [0.855, [1.000, 0.204, 0.000]], [0.857, [1.000, 0.190, 0.000]], [0.859, [1.000, 0.190, 0.000]], [0.861, [1.000, 0.175, 0.000]], [0.863, [1.000, 0.175, 0.000]], [0.865, [1.000, 0.160, 0.000]], [0.867, [1.000, 0.160, 0.000]], [0.869, [1.000, 0.146, 0.000]], [0.871, [1.000, 0.146, 0.000]], [0.873, [1.000, 0.131, 0.000]], [0.875, [1.000, 0.131, 0.000]], [0.877, [1.000, 0.117, 0.000]], [0.879, [1.000, 0.117, 0.000]], [0.881, [1.000, 0.102, 0.000]], [0.883, [1.000, 0.102, 0.000]], [0.885, [1.000, 0.088, 0.000]], [0.886, [1.000, 0.088, 0.000]], [0.888, [0.999, 0.073, 0.000]], [0.890, [0.999, 0.073, 0.000]], [0.892, [0.981, 0.059, 0.000]], [0.894, [0.981, 0.059, 0.000]], [0.896, [0.963, 0.044, 0.000]], [0.898, [0.963, 0.044, 0.000]], [0.900, [0.946, 0.030, 0.000]], [0.902, [0.946, 0.030, 0.000]], [0.904, [0.928, 0.015, 0.000]], [0.906, [0.928, 0.015, 0.000]], [0.908, [0.910, 0.001, 0.000]], [0.910, [0.910, 0.001, 0.000]], [0.912, [0.892, 0.000, 0.000]], [0.914, [0.892, 0.000, 0.000]], [0.916, [0.874, 0.000, 0.000]], [0.918, [0.874, 0.000, 0.000]], [0.920, [0.857, 0.000, 0.000]], [0.922, [0.857, 0.000, 0.000]], [0.924, [0.839, 0.000, 0.000]], [0.926, [0.839, 0.000, 0.000]], [0.928, [0.821, 0.000, 0.000]], [0.930, [0.821, 0.000, 0.000]], [0.932, [0.803, 0.000, 0.000]], [0.933, [0.803, 0.000, 0.000]], [0.935, [0.785, 0.000, 0.000]], [0.937, [0.785, 0.000, 0.000]], [0.939, [0.767, 0.000, 0.000]], [0.941, [0.767, 0.000, 0.000]], [0.943, [0.750, 0.000, 0.000]], [0.945, [0.750, 0.000, 0.000]], [0.947, [0.732, 0.000, 0.000]], [0.949, [0.732, 0.000, 0.000]], [0.951, [0.714, 0.000, 0.000]], [0.953, [0.714, 0.000, 0.000]], [0.955, [0.696, 0.000, 0.000]], [0.957, [0.696, 0.000, 0.000]], [0.959, [0.678, 0.000, 0.000]], [0.961, [0.678, 0.000, 0.000]], [0.963, [0.660, 0.000, 0.000]], [0.965, [0.660, 0.000, 0.000]], [0.967, [0.643, 0.000, 0.000]], [0.969, [0.643, 0.000, 0.000]], [0.971, [0.625, 0.000, 0.000]], [0.973, [0.625, 0.000, 0.000]], [0.975, [0.607, 0.000, 0.000]], [0.977, [0.607, 0.000, 0.000]], [0.978, [0.589, 0.000, 0.000]], [0.980, [0.589, 0.000, 0.000]], [0.982, [0.571, 0.000, 0.000]], [0.984, [0.571, 0.000, 0.000]], [0.986, [0.553, 0.000, 0.000]], [0.988, [0.553, 0.000, 0.000]], [0.990, [0.536, 0.000, 0.000]], [0.992, [0.536, 0.000, 0.000]], [0.994, [0.518, 0.000, 0.000]], [0.996, [0.518, 0.000, 0.000]], [0.998, [0.500, 0.000, 0.000]], [1.000, [0.500, 0.000, 0.000]]];
function enforceBounds(x) {
if (x < 0) {
return 0;
} else if (x > 1){
return 1;
} else {
return x;
}
}
function interpolateLinearly(x, values) {
// Split values into four lists
var x_values = [];
var r_values = [];
var g_values = [];
var b_values = [];
for (i in values) {
x_values.push(values[i][0]);
r_values.push(values[i][1][0]);
g_values.push(values[i][1][1]);
b_values.push(values[i][1][2]);
}
var i = 1;
while (x_values[i] < x) {
i = i+1;
}
i = i-1;
var width = Math.abs(x_values[i] - x_values[i+1]);
var scaling_factor = (x - x_values[i]) / width;
// Get the new color values though interpolation
var r = r_values[i] + scaling_factor * (r_values[i+1] - r_values[i])
var g = g_values[i] + scaling_factor * (g_values[i+1] - g_values[i])
var b = b_values[i] + scaling_factor * (b_values[i+1] - b_values[i])
return [enforceBounds(r), enforceBounds(g), enforceBounds(b)];
}
function drawColormap(CanvasID, colormap) {
var c = document.getElementById(CanvasID);
var width = c.width;
var height = c.height;
var ctx = c.getContext("2d");
for (i = 0; i <= width; i++) {
var color = interpolateLinearly(i/width, colormap);
r = Math.round(255*color[0]);
g = Math.round(255*color[1]);
b = Math.round(255*color[2]);
ctx.fillStyle = 'rgb('+r+', '+g+', '+b+')';
ctx.fillRect(i, 0, 1, height);
}
}