6408| 2
|
[求助] makecode中三角函数的计算问题 |
[mw_shl_code=applescript,true]let item = 0 let c = 0 let y = 0 let b = 0 let x = 0 let a = 0 function doSomething() { x = b * b + c * c - a * a y = 2 * (b * c) } function doSomething2() { x = a * a + c * c - b * b y = 2 * (a * c) } function doSomething3() { x = a * a + b * b - c * c y = 2 * (a * b) } input.onButtonPressed(Button.A, () => { doSomething() basic.showString("COS" + "A" + "=" + item + "." + x * 100 / y) }) input.onButtonPressed(Button.B, () => { doSomething2() basic.showString("COS" + "B" + "=" + item + "." + x * 100 / y) }) input.onButtonPressed(Button.AB, () => { doSomething3() basic.showString("COS" + "C" + "=" + item + "." + x * 100 / y) }) a = 3 b = 4 c = 5 item = x / y[/mw_shl_code] |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed