【发布时间】:2015-11-08 22:45:32
【问题描述】:
我正在使用左声道和右声道来创建 Lissajous Vectorscope。 Left 是 x,Right 是 y,两者都不会超过 1 和 -1 值。这些坐标也以 45 度角移动,以提供以下视图。
所以我在做一个很简单的
// converting x and y value from (-1 - 1) to (0 - 1)
float x = LeftChannelValue/2 + 0.5
float y = RightChannelValue/2 + 0.5
// multiplying the width and height with X and Y to get a proper square
// width and height have to be the same value
float new_X = x*(width*0.5)
float new_Y = y*(height*0.5)
// doing two dimensional rotating to 45 degrees so it's easier to read
float cosVal = cos(0.25*pi)
float sinVal = sin(0.25*pi)
float finalX = (((new_X*cosVal)-(new_Y *sinVal))) + (width*0.5) //adding to translate back to origin
float finalY = ((new_X*sinVal) + (new_Y *cosVal))
这给了我那张照片的结果。
如何绘制极坐标图,使其看起来不像正方形,而更像圆形? 我试图得到这个观点,但我对这与左右的关系感到非常困惑。我使用https://en.wikipedia.org/wiki/Polar_coordinate_system 作为参考。
【问题讨论】:
-
李萨如图不涉及笛卡尔/极坐标变换 - 您的目标是什么?
-
我已经有一个笛卡尔的利萨如图。我想将其转换为从 0 到 360 度的极坐标图。这就是我想要的。我想看起来像这样 help.izotope.com/docs/ozone/pages/images/… 但 360 度而不是 180 度
-
找出问题所在,发布答案。谢谢!
标签: c++ polar-coordinates