当前位置:网站首页>在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
边栏推荐
- Anti shake and throttling
- 內網滲透系列:內網隧道之icmpsh
- BUUCTF [极客大挑战 2019]EasySQL1
- Mobile terminal layout (3D conversion, animation)
- Internal network security attack and defense: a practical guide to penetration testing (IV): Authority improvement analysis and defense
- Quick rehearsal exercise
- 1+x云计算中级--脚本搭建读写分离
- 攻防世界MISC刷题1-50
- 智能名片小程序名片详情页功能实现关键代码
- 以下程序实现从字符串str中删除第i个字符开始的连续n个字
猜你喜欢

1216_MISRA_C规范学习笔记_控制流的规则要求

随笔(不定时更新)

Buuctf misc brush questions

数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲

Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
![BUUCTF [极客大挑战 2019]EasySQL1](/img/ad/afca09bc1da003393319af700e90e3.png)
BUUCTF [极客大挑战 2019]EasySQL1

Essays (updated from time to time)

Mobile terminal layout (3D conversion, animation)

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

Feign源码分析
随机推荐
Redis -- why is the string length of string emstr the upper limit of 44 bytes?
访问数据库的时候出现错误 Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.详解
A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
随笔(不定时更新)
Go语学习笔记 - 数组 | 从零开始Go语言
Summary of facial classics
Redis事务实现乐观锁原理
NLLLoss+log_SoftMax=CE_Loss
DVWA靶场练习
Cloud computing skills competition -- Part 2 of openstack private cloud environment
使用 Ingress 实现金丝雀发布
feign如何集成hystrix
Implementation of new
渗透测试面试合集---HVV---
LeetCoed18. 四数之和
Feign源码分析
3C装配中的机械臂运动规划
一些关于网络安全的好教程或笔记的链接,记录一下
CTF-MISC学习之从开始到放弃
MYSQL——第一章节(数据类型2)