⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawang.m

📁 robot_simulator of system
💻 M
字号:
%drawang.m - plots a ray based on starting posn, theta, and magnitude
%  written by: Shawn Lankton
%  for: ECE8843 (sort-of) fun (mostly)
%
%  This draws rays coming from the center of the robot.  I use these to
%  help visulize rangefinders.  This is called from drawbot.
%
%  Inputs:
%    posn - [yposn, mag]
%    mag - length of the line (pixels)
%
%  Outputs:
%    none
%

function drawang(posn, mag)

% do some polar to cartesian math
y = [posn(1), posn(1)+ mag*sin(posn(3))];
x = [posn(2), posn(2)+ mag*cos(posn(3))];

%plot the line
plot(y,x,'r');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -