gpt4 book ai didi

C# 将幅度/相位转换为实数/虚数

转载 作者:太空宇宙 更新时间:2023-11-03 18:45:03 25 4
gpt4 key购买 nike

如果我得到了傅里叶变换的极坐标,并且我想返回到笛卡尔(实数/虚数)坐标,我该怎么做呢?

我可以使用以下代码从笛卡尔坐标中获取极坐标数:

    private double GetPhase(double real, double imaginary)
{
return Math.Atan2(imaginary, real);
}

private double GetMagnitude(double real, double imaginary)
{
return Math.Sqrt((real * real) + (imaginary * imaginary));
}

但是我怎么回去呢?

最佳答案

这不就是:

(伪代码)

x = cos(angle) * magnitude
y = sin(angle) * magnitude

(如果您使用的是计算机的倒坐标系,请使用负 sin)?

关于C# 将幅度/相位转换为实数/虚数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5227127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com