Maple:如何将圆柱坐标转换为笛卡尔坐标?
我们在 圆柱坐标 (r, phi, z ) 中得到一些表达式,例如: expr := r*z^2*sin((1/3)*
phi)
我们需要将其转换为 笛卡尔坐标,然后返回圆柱坐标。这样的事该怎么办呢?
所以我发现了这样的东西: eval(expr, {r = sqrt(x^2+y^2), z = z,
phi= arctan(y, x)})< /code> 但这似乎不正确,如何纠正它以及如何使 eval 将后字从笛卡尔转换为圆柱?
ϕ
== phi
所以我尝试:
R := 1;
H := h;
sigma[0] := sig0;
sigma := sigma[0]*z^2*sin((1/3)*`ϕ`);
toCar := eval(sigma, {r = sqrt(x^2+y^2), z = z, `ϕ` = arctan(y, x)});
toCyl := collect(eval(toCar, {x = r*cos(`ϕ`), y = r*sin(`ϕ`), z = z}), `ϕ`)
它看起来接近真实,但看起来:
为什么 arctan(r*sin(
phi), r*cos(
phi))
不显示为 phi?
实际上,这对我来说只是有趣的开始,因为我还需要计算
Q := int(int(int(toCar, x = 0 .. r), y = 0 .. 2*Pi), z = 0 .. H)
并将其恢复到圆柱坐标中......
We get some expression in Cylindrical coordinates (r, ϕ, z ) like : expr := r*z^2*sin((1/3)*
ϕ)
we need to convert it into Cartesian coordinates and than back to Cylindrical coordinates. How to do such thing?
So I found something like this : eval(expr, {r = sqrt(x^2+y^2), z = z,
ϕ= arctan(y, x)})
but it seems incorrect, how to correct it and how make eval to convert backwords from Cartesian to Cylindrical?
ϕ
== ϕ
So I try:
R := 1;
H := h;
sigma[0] := sig0;
sigma := sigma[0]*z^2*sin((1/3)*`ϕ`);
toCar := eval(sigma, {r = sqrt(x^2+y^2), z = z, `ϕ` = arctan(y, x)});
toCyl := collect(eval(toCar, {x = r*cos(`ϕ`), y = r*sin(`ϕ`), z = z}), `ϕ`)
It looks close to true but look:
why arctan(r*sin(
ϕ), r*cos(
ϕ))
is not shown as ϕ?
Actually it is only begining of fun time for me because I also need to calculate
Q := int(int(int(toCar, x = 0 .. r), y = 0 .. 2*Pi), z = 0 .. H)
and to get it back into Cylindrical coordinates...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,
一旦从圆柱形转换为矩形,有关原始角度“可能环绕(过去 -Pi)多少次的任何信息都会丢失。
因此,您将无法恢复原始的
ϕ< /code> 除非它在 (-Pi,Pi] 中。如果你告诉 Maple 是这种情况(以及 r>-0 以便它知道哪个半平面),使用假设,那么它可以简化为你的内容重新期待。
Notice,
Once you've converted from cylindrical to rectangular, any information about how many times the original angle" might have wrapped around (past -Pi) is lost.
So you won't recover the original
ϕ
unless it was in (-Pi,Pi]. If you tell Maple that is the case (along with r>-0 so that it knows which half-plane), using assumptions, then it can simplify to what you're expecting.