惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 朱小勇

解决Qt无法cdb调试问题 使用zadig-安装winusb驱动 libusb编译 word设置表和图的自动编号 DAC、AOC、AEC、ACC说明 技能包:qtwidget-instrument-control SKILL技能包学习 T参数 Python查看某个库版本并更新 C++通过pybind11与Python互调 数字信号处理-C++开源库 C++实现窗函数 C++-FFTW C++-Eigen SI-python工程参考 PAM4相关概念 win11共享文件夹 Qt使用QSplashScreen实现软件启动过渡界面 QGroundControl 建议尺寸 封窗知识 网分的触发学习 豆包生成图片去除水印 信号完整性测试中的EIPS指标 windows将服务器文件夹映射到windows本地 单端口误差模型
matlabe东向偏移、北向偏移、垂直偏移转经纬度
朱小勇 · 2025-10-13 · via 博客园 - 朱小勇

1.代码

function [target_lat, target_lon, target_alt] = relative2geodetic(ref_lat, ref_lon, ref_alt, east_offset, north_offset, up_offset)
% 将相对偏移转换为地理坐标系
% 输入:
%   ref_lat, ref_lon, ref_alt - 参考点的纬度、经度、高度(度, 度, 米)
%   east_offset, north_offset, up_offset - 东向、北向、垂直偏移量(米)
% 输出:
%   target_lat, target_lon, target_alt - 目标点的纬度、经度、高度

    % 地球参数(WGS84椭球体)
    a = 6378137.0;        % 地球长半轴(米)
    f = 1/298.257223563;  % 扁率
    e2 = 2*f - f*f;       % 第一偏心率平方
    
    % 将参考点经纬度转换为弧度
    lat_rad = deg2rad(ref_lat);
    lon_rad = deg2rad(ref_lon);
    
    % 计算子午圈曲率半径和卯酉圈曲率半径
    N = a / sqrt(1 - e2 * sin(lat_rad)^2);
    M = a * (1 - e2) / (1 - e2 * sin(lat_rad)^2)^(3/2);
    
    % 计算经纬度变化量
    dlat = rad2deg(north_offset / M);
    dlon = rad2deg(east_offset / (N * cos(lat_rad)));
    
    % 计算目标点坐标
    target_lat = ref_lat + dlat;
    target_lon = ref_lon + dlon;
    target_alt = ref_alt + up_offset;
end

2.测试

fprintf('=== 示例1:基本转换 ===\n');


% % 参考点坐标(北京天安门)
% ref_lat = 39.9087;    % 纬度(度)
% ref_lon = 116.3975;   % 经度(度)
% ref_alt = 50.0;       % 高度(米)
% 
% % 相对偏移量(米)
% east_offset = 1000;   % 东向偏移
% north_offset = 500;   % 北向偏移  
% up_offset = 10;       % 垂直偏移
% 
% % 转换为地理坐标
% [target_lat, target_lon, target_alt] = relative2geodetic(...
%     ref_lat, ref_lon, ref_alt, east_offset, north_offset, up_offset);
% 
% fprintf('参考点: (%.6f°N, %.6f°E, %.2fm)\n', ref_lat, ref_lon, ref_alt);
% fprintf('相对偏移: 东%.1fm, 北%.1fm, 上%.1fm\n', east_offset, north_offset, up_offset);
% fprintf('目标点: (%.6f°N, %.6f°E, %.2fm)\n\n', target_lat, target_lon, target_alt);


% 参考点坐标(北京天安门)
ref_lat = 0;    % 纬度(度)
ref_lon = 0;   % 经度(度)
ref_alt = 0;       % 高度(米)

% 相对偏移量(米)
east_offset = 1000;   % 东向偏移
north_offset = 1000;   % 北向偏移  
up_offset = 1000;       % 垂直偏移

% 转换为地理坐标
[target_lat, target_lon, target_alt] = relative2geodetic(...
    ref_lat, ref_lon, ref_alt, east_offset, north_offset, up_offset);

fprintf('参考点: (%.6f°N, %.6f°E, %.2fm)\n', ref_lat, ref_lon, ref_alt);
fprintf('相对偏移: 东%.1fm, 北%.1fm, 上%.1fm\n', east_offset, north_offset, up_offset);
fprintf('目标点: (%.6f°N, %.6f°E, %.2fm)\n\n', target_lat, target_lon, target_alt);