SOURCE

function test(w,pl,l,pv,h){
    let plList = {
        '-5': 1.4224,
        '-4': 1.3943,
        '-3': 1.3673,
        '-2': 1.3413,
        '-1': 1.3163,
        '0': 1.2922,
        '1': 1.2690,
        '2': 1.2466,
        '3': 1.2250,
        '4': 1.2041,
        '5': 1.1839,
        '6': 1.1644,
        '7': 1.1455,
        };
    let pvList = {
        '0': 1000,
        '1': 999.97,
        '2': 999.70,
        '3': 999.10,
        '4': 999.21,
        '5': 997.05,
        '6': 995.65,
        '7': 994.03,
        '8': 992.22,
        '9': 990.21,
        '10': 988.04,
    };
    let plToken = pl%5
    let plData = plList[plToken];
    let pvToken = pv%5
    let pvData = pvList[pvToken];
    let cd = 0.001465;
    if(w<11){
        cd = 0.0012;
    }else if(w>=20){
        cd = 0.00175;
    }
    console.log('cd: '+ cd)
    console.log('plData: '+ plData)
    console.log('w: '+ w)
    console.log('l: '+ l)
    console.log('pvData: '+ pvData)
    console.log('h: '+ h)
    let dh = (cd*plData*w*l)/(9.8*pvData*h)
    console.log('dh: '+ dh)
    return dh
}

test(12,30,5000,32,6)
console 命令行工具 X clear

                    
>
console