歯車について勉強する3 の履歴(No.1)
更新- 履歴一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- 工作/歯車について勉強する3 へ行く。
LANG:p5js_live
function input(i, label, value, func) {
p.createSpan(label).position(0, 20 * i + 10);
myInput = p.createInput(value).position(150, 20 * i + 10);
if (func) {
myInput.input(func);
} else {
myInput.elt.disabled = true;
}
return myInput;
}
const inputs = {};
p.recalc = () => {
inputs.pitch.value(inputs.m.value() * Math.PI);
inputs.mn.value(
inputs.m.value() / Math.cos((inputs.beta.value() / 180) * Math.PI)
);
inputs.pitchn.value(inputs.mn.value() * Math.PI);
inputs.dp.value(inputs.mn.value() * inputs.z.value());
}
p.setup = () => {
p.createSpan("はすば歯車設計").position(0, 0);
inputs.m = input(1, "歯直角モジュール", 4, recalc);
inputs.z = input(2, "歯数", 12, recalc);
inputs.pitch = input(3, "歯直角ピッチ", 0);
inputs.beta = input(4, "ねじれ角", 0, recalc);
inputs.mn = input(5, "正面モジュール", 4);
inputs.pitchn = input(6, "正面ピッチ", 0);
inputs.dp = input(7, "基準直径", 0);
recalc();
}
Counter: 2088 (from 2010/06/03),
today: 15,
yesterday: 12