当前位置:网站首页>在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
2022-04-23 06:45:00 【Dream of Grass】
在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
用rectangle函数
我们将使用matlab的rectangle,来画圆。
简单看看官方文档
rectangle('Position',pos,'Curvature',cur) 为矩形的边添加曲率。要沿水平边和垂直边使用不同的曲率,请将 cur 指定为 [horizontal vertical] 形式的二元素向量。要沿所有边使用相同的曲率,请将 cur 指定为一个标量值。请将值指定为 0(无曲率)和 1(最大曲率)之间的值。使用 [1 1] 创建一个椭圆形或圆形。

文档中还给出了一个实例,不过这个实例的pos参数不太直观,还达不到给出圆心坐标和半径就能画圆的目的。
下面就给出能够实现目的的代码,实际运用的时候分别给x y r 赋值即可。
x = 横坐标;
y = 纵坐标;
r = 半径;
rectangle('Position',[x-r,y-r,2*r,2*r],'Curvature',[1,1],'EdgeColor','m')
下图是画好多好多圆的一个示意图。

谢谢大家!
版权声明
本文为[Dream of Grass]所创,转载请带上原文链接,感谢
https://blog.csdn.net/dream_of_grass/article/details/124266134
边栏推荐
- 内网渗透系列:内网隧道之icmpsh
- Internal network security attack and defense: a practical guide to penetration testing (VII): cross domain attack analysis and defense
- Feign源码分析
- Three minutes to teach you to use Houdini fluid > > to solve particle fluid droplets
- 内网渗透系列:内网隧道之dns2tcp
- CTF attack and defense world brush questions 51-
- NIH降血脂指南《your guide to lowering your Cholesterol with TLC》笔记(持续更新中)
- Redis--为什么字符串emstr的字符串长度是44字节上限?
- Research on system and software security (I)
- CTF攻防世界刷题51-
猜你喜欢

內網滲透系列:內網隧道之icmpsh

How does feign integrate hystrix

Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack

Intranet penetration series: pingtunnel of Intranet tunnel

Go语学习笔记 - 语言接口 | 从零开始Go语言

Intranet penetration series: icmpsh of Intranet tunnel

内网渗透系列:内网隧道之dns2tcp

nacos源码分析思路
![[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP](/img/6c/7408180d0c24560b4a68982635520e.jpg)
[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP

SAP sto with billing process and configuration
随机推荐
Analysis of Nacos source code
Research on system and software security (5)
CSV Column Extract列提取
Intranet penetration series: dns2tcp of Intranet tunnel
随笔(不定时更新)
LeetCode 1611. 使整数变为 0 的最少操作次数
3C装配中的机械臂运动规划
一些关于网络安全的好教程或笔记的链接,记录一下
Upload labs range practice
SAP tr manual import system operation manual
数据库之Mysql——概述安装篇
Mobile web (Font Icon, plane conversion, color gradient)
BUUCTF MISC刷題
国基北盛-openstack-容器云-环境搭建
Feign source code analysis
Research on software security based on NLP (I)
Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain
Solidity IDE Remix中文版使用手册
Redis事务实现乐观锁原理
MySQL -- the secret of lock -- how to lock data