当前位置:网站首页>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边栏推荐
- In the era of data processing, data analysis has become the basic construction
- Jsp基于ssm项目实验室管理系统设计与现实.doc
- Chapter 161 SQL function year
- c(指针02)
- 【Vulnhub靶场】JANGOW: 1.0.1
- Upgrade the playing method of snatching singing, integrate the climax clips of genuine music and real-time scoring ability~
- Framework and practice of smart city network security construction
- mysql(17-觸發器)
- nodejs-判断系统类型-获取主机名称-执行控制台命令-中文乱码
- Pits encountered during the use of ETL (ETL Chinese garbled)
猜你喜欢

Adobe Premiere foundation - tool use (selection tool, razor tool, and other common tools) (III)

Morris traversal of binary tree

2022.05.25(LC_718_最长重复子数组)

直播预告 | 解构OLAP!新型多维分析架构范式全公开!Apache Doris 将带来五个重磅议题!

【web】个人主页web大作业「课表」「相册」「留言板」

腾讯云数据库TDSQL-大咖论道 | 基础软件的过去、现在、未来

C (pointer-02)

Upgrade the playing method of snatching singing, integrate the climax clips of genuine music and real-time scoring ability~

Pits encountered during the use of ETL (ETL Chinese garbled)

Source code analysis and practical testing openfeign load balancing
随机推荐
Nodejs basic architecture analysis parsing engine directory plug-in installation core module
[Agency] 10 minutes to master the essential difference between forward agency and reverse agency
第三章 数据类型(二)
SQL statement to view the basic table structure and constraint fields, primary codes and foreign codes in the table (simple and effective)
Performance and high availability analysis of database firewall
mysql(17-课后练习题)
个人如何投资理财比较安全?
How to play the Dragon Boat Festival "immersive cloud Tour"? That is to say, it helps "live broadcast +" new scene landing
c(指针-02)
Openssl1.1.1 vs2013 compilation tutorial
Vs solution to garbled Chinese characters read from txt files (super simple)
SQL语句查看基本表结构和表中约束字段 、主码、外码 (简单有效)
Adobe Premiere foundation - material nesting (animation of Tiktok ending avatar) (IX)
多通道信号数据压缩存储
Framework and practice of smart city network security construction
WordPress 6.0 "Arturo Arturo" release
How to transform digital transformation? Which way?
MySQL (17 after class exercises)
Low carbon data center construction ideas and future trends
2022.05.27(LC_647_回文子串)