Public
Edited
Oct 24, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height = 600;
Insert cell
width = 600;
Insert cell
maxHeight = droneHeight + 1000;
Insert cell
altA = Math.PI * altA_deg / 180
Insert cell
// altB = Math.PI * (altA_deg + altDelta_deg) / 180

altB = Math.atan2(DB[1], -(DB[0] + 750))
Insert cell
A = [0, 0];
Insert cell
B = [-750, 0];
Insert cell
DA = [A[0] - Math.cos(altA) * (droneHeight / Math.sin(altA)), droneHeight];
Insert cell
// DB = [B[0] - Math.cos(altB) * (droneHeight / Math.sin(altB)), droneHeight];
DB = [DA[0] + droneSpeed * 0.2778 * 16, droneHeight]
Insert cell
a = 1 - input[4]/16.1
Insert cell
AB_mid = [A[0]*a + B[0]*(1-a), A[1]*a + B[1]*(1-a)]
Insert cell
DADB_mid = [DA[0]*a + DB[0]*(1-a), DA[1]*a + DB[1]*(1-a)]
Insert cell
BABB_mid = [BA[0]*a + BB[0]*(1-a), BA[1]*a + BB[1]*(1-a)]
Insert cell
BABB_50 = [BA[0]*0.5 + BB[0]*(1-0.5), BA[1]*0.5 + BB[1]*(1-0.5)]
Insert cell
// droneSpeed = Math.round(3.6 * Math.abs((DA[0] - DB[0]) / 16.08));
droneSpeed = input[1];
Insert cell
BA = [A[0] - Math.cos(altA) * (balloonHeight / Math.sin(altA)), balloonHeight];
Insert cell
BB = [B[0] - Math.cos(altB) * (balloonHeight / Math.sin(altB)), balloonHeight];
Insert cell
balloonSpeed = Math.round(3.6 * Math.abs((BA[0] - BB[0]) / 16.08));
Insert cell
altDelta_deg = input[4];
Insert cell
altA_deg = 90 - input[3];
Insert cell
droneHeight = input[0];
Insert cell
balloonHeight = Math.min(input[0]-100, input[2]);
Insert cell
balloonSize = Math.round(100*(droneHeight - balloonHeight) / droneHeight * 0.43)/100
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more