当前位置:网站首页>Matlab draws ellipse code according to any angle, sampling points (resolution), position and size
Matlab draws ellipse code according to any angle, sampling points (resolution), position and size
2022-06-10 19:29:00 【EMB night watching lights】
20 A little bit , Deflection 30 degree . Don't forget to like it .
1、 effect

2、 Code
function ellipse_point = get_ellipse(center_point, r_a_b, angle_in, point_num)
% Call example
% r_a = 20;% Long radius
% r_b = 10;% Short radius
% angle = 30; % Rotation Angle
% a = 20;% The abscissa of the center of the circle
% b = 10;% The ordinate of the center of the circle
% point_num = 20; % Sampling points
% 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);% Long radius
r_b = r_a_b(2);% Short radius
angle = deg2rad(angle_in);
a = center_point(1);% The abscissa of the center of the circle
b = center_point(2);% The ordinate of the center of the circle
theta = 0:2*pi/point_num:2*pi; % angle [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]; % Rotation matrix
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边栏推荐
- Google Earth engine (GEE) -- Copernicus atmosphere monitoring (CAMs) global aerosol AOI near real-time observation data set
- Multi channel signal data compression storage
- 第二章 数据类型(一)
- [database language SPL] a simple and fast database language SPL
- Ruixin micro rk1126 platform platform porting libevent cross compiling libevent
- openSSL1.1.1编译错误 Can‘t locate Win32/Console.pm in @INC
- Basic model and properties of SAR echo signal
- 2022.05.24(LC_674_最长连续递增序列)
- Openssl1.1.1 vs2013 compilation tutorial
- Analysis of optical storage direct flexible power distribution system
猜你喜欢

Low carbon data center construction ideas and future trends

openSSL1.1.1编译错误 Can‘t locate Win32/Console.pm in @INC

Analysis of optical storage direct flexible power distribution system

2022.05.28(LC_516_最长回文子序列)

2022.05.26(LC_1143_最长公共子序列)

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

Use of uiautomator2 automated test tool

【web】個人主頁web大作業「課錶」「相册」「留言板」

Leecode27977 double finger needling

2022.05.24(LC_674_最长连续递增序列)
随机推荐
SAR回波信号基本模型与性质
Longest ascending subsequence (LIS) Logu
源码分析及实践测试OpenFeign负载均衡
【 Web 】 page d'accueil personnelle 】 Programme d'études 】 albums de photos 】 babillard d'information 】
一文带你了解J.U.C的FutureTask、Fork/Join框架和BlockingQueue
Monotonic stack structure
lingo12软件下载及lingo语言入门资源
Upgrade the playing method of snatching singing, integrate the climax clips of genuine music and real-time scoring ability~
Explain the interview questions by holding chestnuts (interview, review and study)
SQL 函数
Chapter 1 SQL operators
2022.05.25(LC_718_最长重复子数组)
直播预告 | 解构OLAP!新型多维分析架构范式全公开!Apache Doris 将带来五个重磅议题!
Multi channel signal data compression storage
Performance and high availability analysis of database firewall
2022.05.29(LC_6078_重排字符形成目标字符串)
OPENCV 检测人脸 不依赖于任何第三方库
【C语言进阶】指针的进阶【中篇】
Basic improvement - tree DP supplement
JS Standard