求助一道matlab坐标系的题目题目是:Input a non-variable vector in rectangular coordinates and obtain the cylindrical, or spherical components. Must enter the point location where this transformation occurs; the result depends on the vect

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 17:15:59
求助一道matlab坐标系的题目题目是:Inputanon-variablevectorinrectangularcoordinatesandobtainthecylindrical,orspheri

求助一道matlab坐标系的题目题目是:Input a non-variable vector in rectangular coordinates and obtain the cylindrical, or spherical components. Must enter the point location where this transformation occurs; the result depends on the vect
求助一道matlab坐标系的题目
题目是:Input a non-variable vector in rectangular coordinates and obtain the cylindrical, or spherical components. Must enter the point location where this transformation occurs; the result depends on the vector’s observation point.
大意是说在直角坐标系里给定一个起点不是原点的向量,求其转换成圆柱坐标系和球坐标系的坐标
求大神帮忙!

求助一道matlab坐标系的题目题目是:Input a non-variable vector in rectangular coordinates and obtain the cylindrical, or spherical components. Must enter the point location where this transformation occurs; the result depends on the vect
clc;
disp('直角坐标')
a=[3 4 5]
plot3([0 a(1)],[0 a(2)],[0 a(3)]);
text(0,0,0,'O');
text(a(1),a(2),a(3),'P');
disp('柱坐标')
r=norm(a(1:2));
st=acos(a(1)/r);
azhu=[r st a(3)]
disp('球坐标')
r=norm(a);
rxy=norm(a(1:2));
rf=acos(rxy/r);
st=acos(a(1)/rxy);
azhu=[r st a(3)]