rect2polar.m
来自「matlab programming for engineers(2nd)书籍源」· M 代码 · 共 23 行
M
23 行
function [r, theta] = rect2polar(x,y)
%RECT2POLAR Convert rectangular to polar coordinates
% Function RECT2POLAR accepts the rectangular coordinates
% (x,y) and converts them into the polar coordinates
% (r,theta), where theta is expressed in degrees.
%
% Calling sequence:
% [r, theta] = rect2polar(x,y)
% Define variables:
% r -- Length of polar vector
% theta -- Angle of vector in degrees
% x -- x-position of point
% y -- y-position of point
% Record of revisions:
% Date Programmer Description of change
% ==== ========== =====================
% 02/01/07 S. J. Chapman Original code
r = sqrt( x.^2 + y .^2 );
theta = 180/pi * atan2(y,x);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?