As title
作为标题
I only have the theta/rho data
我只有/rho数据。
the line equation is
线方程
x*cos(theta)+y*sin(theta)=rho
how to plot line whith these data in matlab?
如何在matlab中绘制这些数据?
are there any function which input are theta and rho?
有什么函数输入是和?
thanks
谢谢
2 个解决方案
#1
4
Just use some simple Algebra to find out how y is related to x.
Take some range for x:
用一些简单的代数方法找出y与x的关系。
x = -10:10;
y = (rho - x* cos(theta) )/ sin(theta);
plot(x,y)
#2
1
You can just use the built in polar function
你可以使用内置的极坐标函数。
polar(theta,rho) creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector specified in dataspace units.
极坐标(,rho)创建了一个角度与半径的极坐标图。是x轴到弧度内的半径矢量的角度;是dataspace单元中指定的半径向量的长度。
You can also transform polar to cartesian with pol2cart() then use the regular plot(x,y) function.
您还可以使用pol2cart()将极坐标转换为cartesian,然后使用常规的plot(x,y)函数。
[X,Y] = pol2cart(THETA,RHO) transforms the polar coordinate data stored in corresponding elements of THETA and RHO to two-dimensional Cartesian, or xy, coordinates. The arrays THETA and RHO must be the same size (or either can be scalar). The values in THETA must be in radians.
[X,Y] = pol2cart(= pol2cart,RHO)将存储在相应元素中的极坐标数据转换为二维笛卡尔坐标或xy坐标。数组和RHO必须是相同的大小(或者可以是标量)。的值必须是弧度。
There is also a cart2pol() function that does the reverse transformation.
还有一个cart2pol()函数,它执行反向转换。
[THETA,RHO] = cart2pol(X,Y) transforms two-dimensional Cartesian coordinates stored in corresponding elements of arrays X and Y into polar coordinates.
[d] = cart2pol(X,Y)将二维笛卡尔坐标转换为将X和Y数组对应的元素存储到极坐标中。
#1
4
Just use some simple Algebra to find out how y is related to x.
Take some range for x:
用一些简单的代数方法找出y与x的关系。
x = -10:10;
y = (rho - x* cos(theta) )/ sin(theta);
plot(x,y)
#2
1
You can just use the built in polar function
你可以使用内置的极坐标函数。
polar(theta,rho) creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector specified in dataspace units.
极坐标(,rho)创建了一个角度与半径的极坐标图。是x轴到弧度内的半径矢量的角度;是dataspace单元中指定的半径向量的长度。
You can also transform polar to cartesian with pol2cart() then use the regular plot(x,y) function.
您还可以使用pol2cart()将极坐标转换为cartesian,然后使用常规的plot(x,y)函数。
[X,Y] = pol2cart(THETA,RHO) transforms the polar coordinate data stored in corresponding elements of THETA and RHO to two-dimensional Cartesian, or xy, coordinates. The arrays THETA and RHO must be the same size (or either can be scalar). The values in THETA must be in radians.
[X,Y] = pol2cart(= pol2cart,RHO)将存储在相应元素中的极坐标数据转换为二维笛卡尔坐标或xy坐标。数组和RHO必须是相同的大小(或者可以是标量)。的值必须是弧度。
There is also a cart2pol() function that does the reverse transformation.
还有一个cart2pol()函数,它执行反向转换。
[THETA,RHO] = cart2pol(X,Y) transforms two-dimensional Cartesian coordinates stored in corresponding elements of arrays X and Y into polar coordinates.
[d] = cart2pol(X,Y)将二维笛卡尔坐标转换为将X和Y数组对应的元素存储到极坐标中。