Published
Edited
Jan 17, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function Distance(lat1,lon1,lat2,lon2) {
var R = 6371; // km (change this constant to get miles)
var dLat = (lat2-lat1) * Math.PI / 180;
var dLon = (lon2-lon1) * Math.PI / 180;
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
return Math.round(d*100)/100
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Information4 = {
let eta = 3*Math.round(Information3/3)
if (eta <= Data6[Data6.length-1][0]) {
let index = eta/3
let wave_eta = Data6[index][1]
return "The ETA is " + Information3 + " hours, and wave height by then is expected to be " + wave_eta + "m."
}
else return "The ETA is " + Information3 + " hours, and there is no available wave height data for this period."
}
Insert cell
Insert cell
Information5 = {
let eta = 3*Math.round(Information3/3)
if (eta <= Data6[Data6.length-1][0]) {
let index = eta/3
let wave_eta = Data6[index][1]
if (wave_eta >= 8){
return "ETA is " + Information3 + " hours, wave height expected to be " + wave_eta + "m, and Vessel A IS NOT operable upon arrival."}
if (wave_eta < 8){
return "ETA is " + Information3 + " hours, wave height expected to be " + wave_eta + "m, and Vessel A is operable upon arrival."}
}
else return "The ETA is " + Information3 + " hours, and there is no available wave height data for this period."
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more