当前位置:网站首页>MATLAB 根据任意角度、取样点数(分辨率)、位置、大小画椭圆代码
MATLAB 根据任意角度、取样点数(分辨率)、位置、大小画椭圆代码
2022-06-10 18:32:00 【EMB看灯夜】
20个点,偏斜30度。 借鉴了别忘记点赞哦。
1、效果

2、代码
function ellipse_point = get_ellipse(center_point, r_a_b, angle_in, point_num)
% 调用例子
% r_a = 20;%长半径
% r_b = 10;%短半径
% angle = 30; % 旋转角度
% a = 20;%圆心横坐标
% b = 10;%圆心纵坐标
% point_num = 20; % 取样点数
% point = get_ellipse([a b], [r_a, r_b],angle,20);
% figure(2)
% plot(point(:,1)',point(:,2)','-')
% axis equal
r_a = r_a_b(1);%长半径
r_b = r_a_b(2);%短半径
angle = deg2rad(angle_in);
a = center_point(1);%圆心横坐标
b = center_point(2);%圆心纵坐标
theta = 0:2*pi/point_num:2*pi; %角度[0,2*pi]
x = a+r_a*cos(theta);
y = b+r_b*sin(theta);
R = [cos(angle) sin(angle) 0; -sin(angle) cos(angle) 0; 0 0 1]; % 旋转矩阵
data_length = length(x);
for i=1 : data_length
temp = [x(i),y(i),1]*R;
x(i) = temp(1);
y(i) = temp(2);
end
ellipse_point = [x',y'];
end边栏推荐
- [database language SPL] a simple and fast database language SPL
- Prospect of database firewall technology [final chapter]
- Adobe Premiere foundation - opacity (matte) (11)
- MySQL advanced Chapter 1 (installing MySQL under Linux) [i]
- Morris traversal of binary tree
- C (pointer-02)
- 直播预告 | 解构OLAP!新型多维分析架构范式全公开!Apache Doris 将带来五个重磅议题!
- Implementation analysis of single image haze removal using dark channel prior
- Analysis of optical storage direct flexible power distribution system
- 基于JSP的医院预约挂号平台设计与开发.zip(论文+项目源码)
猜你喜欢

Adobe Premiere基础-导入导出,合并素材,源文件编译,脱机(二)

What are the current mainstream all-optical technology solutions- Part II
![MySQL advanced Chapter 1 (installing MySQL under Linux) [i]](/img/f9/60998504e20561886b5f62eb642488.png)
MySQL advanced Chapter 1 (installing MySQL under Linux) [i]

Sliding window maximum value problem

【代理】10分钟掌握正向代理和反向代理的本质区别

抢唱玩法升级,正版音乐高潮片段、实时打分能力等你集成~

Seata installing the window environment

MySQL (17 trigger)

Super simple course design SSM student management system (including simple addition, deletion, modification and query of source code)

Request header field XXXX is not allowed by access control allow headers in preflight response
随机推荐
Adobe Premiere Foundation (the last step of video subtitle adding) (6)
基于SSM流量计量云系统的设计与实现.rar(论文+项目源码)
Adobe Premiere Basics - introduction, configuration, shortcut keys, creating projects, creating sequences (I)
2022.05.29(LC_6079_价格减免)
Openssl1.1.1 vs2013 compilation tutorial
Pits encountered during the use of ETL (ETL Chinese garbled)
直播预告 | 社交新纪元,共探元宇宙社交新体验
我的第一部作品:TensorFlow2.x
Nodejs basic architecture analysis parsing engine directory plug-in installation core module
通过举栗子的方式来讲解面试题(可面试,可复习,可学习)
VS从txt文件读取中文汉字产生乱码的解决办法(超简单)
Request header field XXXX is not allowed by access control allow headers in preflight response
阵列信号处理仿真之四——Z变换分析阵列多项式
第一章 SQL操作符
【 random talk 】 congratulations on getting the title of CSDN expert. Your efforts will eventually pay off
nodejs-基本架构分析-解析引擎目录-插件安装-核心模块
Ruixin micro rk1126 platform platform porting libevent cross compiling libevent
Design and implementation of SSM based traffic metering cloud system Rar (thesis + project source code)
AEC:回声产生原因及回声消除原理解析
Wireshark learning notes (I) common function cases and skills