空间3点投影定位算法

               

空间3点投影定位算法

 

本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明.


环境:

 

主机:WIN7

开发环境:Qt


 

说明:

<<仿GPS的4星定位程序>>(http://blog.csdn.net/jdh99/article/details/7349771)提供了空间4点定位1点的算法.实际中此算法需要4个基站有较大的高度差,如果在同一高度则定位误差很大.实际中,定位基站一般装在同一平面.利用平面投影可以将空间定位转换为平面定位从而避免这个问题.

 

具体做法:

每个基站具有平面坐标(x,y)以及一个高度h.测到距离d后,对距离进行平面投影处理:d = sqrt(d^2 - h^2).接下来就是平面定位.

 

测试程序:

界面widget.ui:

<?xml version="1.0" encoding="UTF-8"?><ui version="4.0"> <class>Widget</class> <widget class="QWidget" name="Widget">  <property name="geometry">   <rect>    <x>0</x>    <y>0</y>    <width>561</width>    <height>372</height>   </rect>  </property>  <property name="windowTitle">   <string>Widget</string>  </property>  <widget class="QPushButton" name="pushButton">   <property name="geometry">    <rect>     <x>60</x>     <y>270</y>     <width>75</width>     <height>23</height>    </rect>   </property>   <property name="text">    <string>计算</string>   </property>  </widget>  <widget class="QLineEdit" name="p1x">   <property name="geometry">    <rect>     <x>60</x>     <y>70</y>     <width>41</width>     <height>20</height>    </rect>   </property>   <property name="text">    <string>0</string>   </property>  </widget>  <widget class="QLineEdit" name="d1">   <property name="geometry">    <rect>     <x>360</x>     <y>70</y>     <width>113</width>     <height>20</height>    </rect>   </property>   <property name="text">    <string>1</string>   </property>  </widget>  <widget class="QLabel" name="label">   <property name="geometry">    <rect>     <x>210</x>     <y>20</y>     <width>181</width>     <height>21</height>    </rect>   </property>   <property name="font">    <font>     <pointsize>16</pointsize>    </font>   </property>   <property name="text">    <string>空间3点投影定位</string>   </property>  </widget>  <widget class="QLabel" name="label_2">   <property name="geometry">    <rect>     <x>10</x>     <y>70</y>     <width>48</width>     <height>12</height>    </rect>   </property>   <property name="text">    <string>第1点:</string>   </property>  </widget>  <widget class="QLabel" name="label_3">   <property name="geometry">    <rect>     <x>300</x>     <y>70</y>     <width>48</width>     <height>12</height>    </rect>   </property>   <property name="text">    <string>距离:</string>   </property>  </widget>  <widget class="QLabel" name="label_4">   <property name="geometry">    <rect>     <x>10</x>     <y>110</y>     <width>48</width>     <height>12</height>    </rect>   </property>   <property name="text">    <string>第2点:</string>   </property>  </widget>  <widget class="QLabel" name="label_5">   <property name="geometry">    <rect>     <x>300</x>     <y>110</y>     <width>48</width>     <height>12</height>    </rect>   </property>   <property name="text">    <string>距离:</string>   </property>  </widget>  <widget class="QLabel" name="label_6">   <property name="geometry">    <rect>     <x>10</x>     <y>150</y>     <width>48</width>     <
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值