点击查看代码
<?php
header('Content-Type: text/html; charset=utf-8');
define ('ROOT', $_SERVER['DOCUMENT_ROOT']);
include ROOT.'/assets/php/head.php';
$tit= '计算高度已知水平距和四种坡度表示法';
/**
* 水平距:a 3500
* 百分数:p 5%
* 度数:o 2.86度
* 坡度值:i i=0.05
* 比例:m:n 1:20
* */
$val='3500 5 2.86 0.05 1 20';
$img='';
//调用方法
mill($val,$img,$tit);
//mill 是磨粉机的方法
function mill($val,$img,$tit){
//初始化
include ROOT.'/assets/php/init.php';
imgt($img,$tit);
//设置小数点保留位数
bcscale (2);
//$pi = round(pi(),2);
//以空格分割成数值
$vals = expl($val);
$a = evev($vals[0]);
$p = evev($vals[1]);
$o = evev($vals[2]);
$i = evev($vals[3]);
$m = evev($vals[4]);
$n = evev($vals[5]);
//已知条件
$know = array();
array_push($know, $val);
$v0 = eveq($vals[0]);
array_push($know, "水平距:$v0{$unit['m']}");
$v1 = eveq($vals[1]);
array_push($know, "百分数:$v1{$math['p100']}");
$v2 = eveq($vals[2]);
array_push($know, "度数:$v2{$math['o']}");
$v3 = eveq($vals[3]);
array_push($know, "坡度值:$v3");
$v4 = eveq($vals[4]);
$v5 = eveq($vals[5]);
array_push($know, "比例:{$v4}:{$v5}");
//计算步骤
$step = array();
array_push($step, "计算高度按百分比法:");
array_push($step, "{$math['eq']} $a{$math['mul']}$p{$math['p100']}");
$h1 = bcmul($a, $p/100);
array_push($step, "{$math['eq']} $h1");
array_push($step, "计算高度按度数法:");
array_push($step, "{$math['eq']} $a{$math['mul']}tan{$math['lpar']}$o{$math['o']}{$math['rpar']}");
$tano = tan(deg2rad($o));
array_push($step, "{$math['eq']} $a{$math['mul']}tan{$math['lpar']}$tano{$math['rpar']}");
$h2 = bcmul($a, $tano);
array_push($step, "{$math['eq']} $h2");
array_push($step, "计算高度按坡度值表示法:");
array_push($step, "{$math['eq']} $a{$math['mul']}$i");
$h3 = bcmul($a, $i);
array_push($step, "{$math['eq']} $h3");
array_push($step, "计算高度按比例法:");
array_push($step, "{$math['eq']} $a{$math['mul']}{$math['lpar']}$m{$math['div']}$n{$math['rpar']}");
$mn = bcdiv($m, $n);
array_push($step, "{$math['eq']} $a{$math['mul']}$mn");
$h4 = bcmul($a, $mn);
array_push($step, "{$math['eq']} $h4");
//算出结果
$ends = array();
array_push($ends, "百分比法:{$h1}{$unit['m']}");
array_push($ends, "度数法:{$h2}{$unit['m']}");
array_push($ends, "坡度值表示法:{$h3}{$unit['m']}");
array_push($ends, "比例法:{$h4}{$unit['m']}");
//公式表示
$home = array();
array_push($home, "百分比法:h{$math['eq']}a{$math['mul']}n{$math['p100']}");
array_push($home, "度数法:h{$math['eq']}a{$math['mul']}tan{$math['lpar']}n{$math['o']}{$math['rpar']}");
array_push($home, "坡度值表示法:h{$math['eq']}a{$math['mul']}i");
array_push($home, "比例法:h{$math['eq']}a{$math['mul']}{$math['lpar']}m:n{$math['rpar']}");
//公式说明
$info = array();
array_push($info, "坡度的表示方法有百分比法、度数法、密位法和比例法四种,其中以百分比法和度数法较为常用。密位法这里不作讲解。");
array_push($info, "坡长的计算公式是坡长{$math['eq']}{$math['root2l']}水平距{$math['sup2']}{$math['add']}高度{$math['sup2']}{$math['root2r']}");
know($know);
ends($ends);
home($home);
step($step);
info($info);
}
?>
<?php include ROOT.'/assets/php/foot.php';
//写下记录
$note = array();
note($note);
?>
☁参考上图[22-12-12 chaoyi]
☀计算高度已知水平距和四种坡度表示法
3500 5 2.86 0.05 1 20
水平距:3500m
百分数:5%
度数:2.86°
坡度值:0.05
比例:1:20
♠算出结果
百分比法:175.00m
度数法:174.85m
坡度值表示法:175.00m
比例法:175.00m
♥公式表示
百分比法:h=a×n%
度数法:h=a×tan(n°)
坡度值表示法:h=a×i
比例法:h=a×(m:n)
♣计算步骤
计算高度按百分比法:
= 3500×5%
= 175.00
计算高度按度数法:
= 3500×tan(2.86°)
= 3500×tan(0.049957916025615)
= 174.85
计算高度按坡度值表示法:
= 3500×0.05
= 175.00
计算高度按比例法:
= 3500×(1÷20)
= 3500×0.05
= 175.00
♦公式说明
坡度的表示方法有百分比法、度数法、密位法和比例法四种,其中以百分比法和度数法较为常用。密位法这里不作讲解。
坡长的计算公式是坡长=√₍水平距²+高度²₎
标签:度数,200005,坡度,3500,175.00,高度,表示法,四种
From: https://www.cnblogs.com/onestopweb/p/16975683.html