hu
does anyone have a cartesian to polar conversion object, preferably compatible to max "cartopol"?
also i m askingmyself wether cartopol is the same as rectopol.
i tried it with
expr ($f1 ^ 2 + $f2 ^ 2) ^ .5
for radius and
expr tan ^ -1 ($f2/$f1) (this doesnt really work like this in expr)
for the angle, according to some cheesy equation i got off the net but it sort of gives different results from the max version.
x.j
--
< Þ V · o r g
hi rec2pol from motex (http://www.reverberant.com/Pd) does from rectangular to polar inlets are real(cosine) and imaginary (sine) parts outlets are phase/angle from -Pi to +Pi and amplitude/vektorsum/radius pol2rec is the other way round. sometimes angles are in values from -1 to +1. i think, this could be with the tan^-1 marius.
----- Original Message ----- From: "_-¯-_" jdl@xdv.org To: pd-list@iem.kug.ac.at Sent: Sunday, February 03, 2002 9:33 PM Subject: [PD] cartopol
hu
does anyone have a cartesian to polar conversion object, preferably compatible to max "cartopol"?
also i m askingmyself wether cartopol is the same as rectopol.
i tried it with
expr ($f1 ^ 2 + $f2 ^ 2) ^ .5
for radius and
expr tan ^ -1 ($f2/$f1) (this doesnt really work like this in expr)
for the angle, according to some cheesy equation i got off the net but it sort of gives different results from the max version.
x.j
--
< à V · o r g
Hi,
The syntax of expr is very close to that of the C language. The upchar '^' for expr does not mean to the power of, it is the 'exclusive or' operator.
You can use the following expressions to translate from rectangular to polar coordinates:
x: $f1 y: $f2 magnitude: expr sqrt($f1*$f1+$f2*$f2) phase: expr atan2($f2, $f1) (Replace $f to $v, if you are using expr~ for signals)
atan2() works better than atan() because if you use atan($f2/$f1) you have to do some checking for the case of $f1==0 and figure out the correct phase based on the signs of $f1 and $f2. Also make sure that the y value ($f2) is passed to the expr object prior to the x value ($f1), otherwise you will not get the correct result.
Hope this helps, Shahrokh.
On Sun, 3 Feb 2002, [ISO-8859-1] _-�-_ wrote:
hu
does anyone have a cartesian to polar conversion object, preferably compatible to max "cartopol"?
also i m askingmyself wether cartopol is the same as rectopol.
i tried it with
expr ($f1 ^ 2 + $f2 ^ 2) ^ .5
for radius and
expr tan ^ -1 ($f2/$f1) (this doesnt really work like this in expr)
for the angle, according to some cheesy equation i got off the net but it sort of gives different results from the max version.
x.j
--
< � V � o r g
yep, that helped, thanks.
here is a version of the resulting patch: http://barely.a.live.fm/pd/stff/spatzi_4delay.tgz
it uses the grid object to define the position. and you need this here as well, sorta compatibiltyobject to max: scale like <scale from-min from-max to-min to-max> http://barely.a.live.fm/pd/stff/cxc.xtra/cxc.scale2.pd
in case anyone's interested
Shahrokh Yadegari about Re: [PD] cartopol / Yesterday
|Hi, | |The syntax of expr is very close to that of the C language. The upchar '^' |for expr does not mean to the power of, it is the 'exclusive or' operator. | |You can use the following expressions to translate from rectangular |to polar coordinates: | |x: $f1 |y: $f2 |magnitude: expr sqrt($f1*$f1+$f2*$f2) |phase: expr atan2($f2, $f1) |(Replace $f to $v, if you are using expr~ for signals) | |atan2() works better than atan() because if you use atan($f2/$f1) you have |to do some checking for the case of $f1==0 and figure out the correct |phase based on the signs of $f1 and $f2. Also make sure that the y value |($f2) is passed to the expr object prior to the x value ($f1), otherwise |you will not get the correct result. | |Hope this helps, |Shahrokh. | |On Sun, 3 Feb 2002, [ISO-8859-1] _-¯-_ wrote: | |> |> hu |> |> does anyone have a cartesian to polar conversion object, preferably |> compatible to max "cartopol"? |> |> also i m askingmyself wether cartopol is the same as rectopol. |> |> i tried it with |> |> expr ($f1 ^ 2 + $f2 ^ 2) ^ .5 |> |> for radius and |> |> expr tan ^ -1 ($f2/$f1) (this doesnt really work like this in expr) |> |> for the angle, according to some cheesy equation i got off the net but |> it sort of gives different results from the max version. |> |> x.j |> |> -- |> > < Þ V · o r g |> |> |