当前位置:网站首页>在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
边栏推荐
- Research on system and software security (4)
- Codeforces Round #784 (Div. 4)
- 【编程实践/嵌入式比赛】嵌入式比赛学习记录(二):基于TCP的图片流传输
- Ctf-misc summary
- CSV Column Extract列提取
- 面试学习路线
- 智能名片小程序名片详情页功能实现关键代码
- Research on software security based on NLP (I)
- Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
- 国基北盛-openstack-容器云-环境搭建
猜你喜欢

SAP tr manual import system operation manual
![[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

Feign源码分析

Intranet penetration series: pingtunnel of Intranet tunnel

Chapter V investment real estate

Cloud computing skills competition -- Part 2 of openstack private cloud environment

CTF-MISC学习之从开始到放弃

The displayed amount of ABAP ALV is inconsistent with the exported amount

Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)

输入 “ net start mysql ”,出现 “ 发生系统错误 5。 拒绝访问 ” 。问题详解
随机推荐
[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP
Ctf-misc learning from start to give up
DataBinding的使用五
Implementation principle of instanceof
内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
Implementation of new
学fpga(从verilog到hls)
Buuctf misc brush questions
访问数据库的时候出现错误 Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.详解
使用 Ingress 实现金丝雀发布
upload-labs 靶场练习
C 输出一种二维数组,特点如下。
sentinel集成nacos动态更新数据原理
Reading notes
一文了解系列,对web渗透的常见漏洞总结(持续更新)
渗透测试面试合集---HVV---
BUUCTF MISC刷題
数据库之Mysql——概述安装篇
Go语学习笔记 - 异常处理 | 从零开始Go语言
BUUCTF [极客大挑战 2019]EasySQL1