首页 > 其他分享 >110003 求点B坐标已知点A坐标AB距离方位角

110003 求点B坐标已知点A坐标AB距离方位角

时间:2022-12-04 23:22:21浏览次数:55  
标签:AB 110003 50 求点 坐标 100 80

<?php
header('Content-Type: text/html; charset=utf-8');
define ('ROOT', $_SERVER['DOCUMENT_ROOT']);
include ROOT.'/assets/php/head.php';

$tit= '求点B坐标已知点A坐标AB距离方位角';
//已知点A的x坐标:100,点A的y坐标:80,距离:50,方位角:37
$val='100 80 50 37';
$img='';

//调用方法
mill($val,$img,$tit);

/**
 * mill 是磨粉机的方法
 * $val 传值过来计算,以空格分割成数值
 * $img 自定义图片名,默认以文件名为图片名
 * $tit 标题名
 * */
function mill($val,$img,$tit){
    //初始化
    include ROOT.'/assets/php/init.php';
    imgt($img,$tit);

    //设置小数点保留位数 
    bcscale (2);
    //$pi = round(pi(),2);
    
    //以空格分割成数值
    $vals = expl($val);
    $xA = evev($vals[0]);
    $yA = evev($vals[1]);
    $AB = evev($vals[2]);
    $o = evev($vals[3]);

    //已知条件
    $know = array();
    array_push($know, $val);
    $v0 = eveq($vals[0]);
    array_push($know, "点A的x坐标:$v0");
    $v1 = eveq($vals[1]);
    array_push($know, "点A的y坐标:$v1");
    $v2 = eveq($vals[2]);
    array_push($know, "AB的距离:$v2");
    $v3 = eveq($vals[3]);
    array_push($know, "AB的方位角:$v3{$math['o']}");

    //计算步骤
    $step = array();
    array_push($step, "求点B的x坐标:");
    array_push($step, "{$math['eq']} $xA{$math['add']}$AB{$math['mul']}cos{$math['ang']}$o{$math['o']}");
    $coso = cos(deg2rad($o));
    array_push($step, "{$math['eq']} $xA{$math['add']}$AB{$math['mul']}$coso");
    $ABcoso = bcmul($AB, $coso);
    array_push($step, "{$math['eq']} $xA{$math['add']}$ABcoso");
    $xB = bcadd($xA, $ABcoso);
    array_push($step, "{$math['eq']} $xB");

    array_push($step, "求点B的y坐标:");
    array_push($step, "{$math['eq']} $yA{$math['add']}$AB{$math['mul']}sin{$math['ang']}$o{$math['o']}");
    $sino = sin(deg2rad($o));
    array_push($step, "{$math['eq']} $yA{$math['add']}$AB{$math['mul']}$sino");
    $ABsino = bcmul($AB, $sino);
    array_push($step, "{$math['eq']} $yA{$math['add']}$ABsino");
    $yB = bcadd($yA, $ABsino);
    array_push($step, "{$math['eq']} $yB");
    
    //算出结果
    $ends = array();
    array_push($ends, "点B的x坐标:{$xB}");
    array_push($ends, "点B的y坐标:{$yB}");

    //公式表示
    $home = array();
    array_push($home, "点B的x坐标:xB{$math['eq']}xA{$math['add']}AB{$math['mul']}cos{$math['ang']}AB{$math['o']}");
    array_push($home, "点B的y坐标:yB{$math['eq']}yA{$math['add']}AB{$math['mul']}sin{$math['ang']}AB{$math['o']}");

    //解释说明
    $info = array();
    array_push($info, "根据已知点的坐标和已知点到待定点的坐标方位角和边长,计算待求点的坐标;");
    array_push($info, "这种计算在测量中称为坐标正算。");

    know($know);
    ends($ends);
    home($home);
    step($step);
    info($info);
}
?>
<?php include ROOT.'/assets/php/foot.php'; ?>

结果:

☁参考上图[2022-12-04]  

☀求点B坐标已知点A坐标AB距离方位角  
100 80 50 37  
点A的x坐标:100  
点A的y坐标:80  
AB的距离:50  
AB的方位角:37°  

♠算出结果  
点B的x坐标:139.93  
点B的y坐标:110.09  

♦公式表示  
点B的x坐标:xB=xA+AB×cos∠AB°  
点B的y坐标:yB=yA+AB×sin∠AB°  

♣计算步骤  
求点B的x坐标:  
= 100+50×cos∠37°  
= 100+50×0.79863551004729  
= 100+39.93  
= 139.93  
求点B的y坐标:  
= 80+50×sin∠37°  
= 80+50×0.60181502315205  
= 80+30.09  
= 110.09  

♥解释说明  
根据已知点的坐标和已知点到待定点的坐标方位角和边长,计算待求点的坐标;  
这种计算在测量中称为坐标正算。  

标签:AB,110003,50,求点,坐标,100,80
From: https://www.cnblogs.com/onestopweb/p/16951183.html

相关文章