[PD] rotating coordinate system
Jaime Oliver
jaime.oliver2 at gmail.com
Wed Jul 8 08:21:22 CEST 2009
check: http://en.wikipedia.org/wiki/Rotation_matrix
On Tue, Jul 7, 2009 at 1:41 PM, Achim Bornhoeft <achim at bornhoeft.org> wrote:
> Hello Frank,
> thank you for your prompt answer.
>
> Am 07.07.2009 um 18:44 schrieb Frank Barknecht:
>
> Hallo,
>> Achim Bornhoeft hat gesagt: // Achim Bornhoeft wrote:
>>
>> I need to solve the following problem for different setups of room
>>> distributions.
>>>
>>> Given are x and y values between 0 and 100:
>>>
>>> 0/100 100/100
>>> |
>>> | x
>>> |
>>> | x
>>> |____________
>>> 0/0 100/0
>>>
>>> I would like to transform the same values mathematically in a way that
>>> the result correspond to the coordinate system rotated 45 degrees
>>> clockwise:
>>>
>>> 0/0---------0/100
>>> |
>>> | x
>>> |
>>> | x
>>> |
>>> 100/0 100/100
>>>
>>
>> Isn't this a rotation by 90 degrees shown here? :)
>>
>
> Sure you're right.
>
> Anyway rotating a point is easier if you convert the coordinates to polar
>> coordinates (radius and angle) first, then add the rotation angle to the
>> current angle and convert back.
>>
>> You could do the math yourself, but in Zexy there are some handy
>> abstractions
>> that do it for you: [cart2pol], [pol2cart] convert between cartesian (x,y)
>> and
>> polar (r, phi) coordinates:
>>
>> x y
>> | |
>> [cart2pol]
>> | |
>> | [+ 0.785398] add rotation angle: 0.785398 is 45 degrees converted to
>> rad
>> | |
>> [pol2cart]
>> | |
>> x' y'
>>
>> The phi-angles are specified in rad, not in degrees. If you want to use
>> degree
>> for the rotation angle, the [deg2rad] object is helpful and it's also part
>> of
>> zexy. Or make your own: rad=deg*pi/180
>>
>
> I tried this but without the results I expected.
> Probably it was not very clear how I explained it.
> See attached patch for a better description of what I am looking for.
>
> Achim
>
>
>
>
>
>
> Ciao
>> --
>> Frank
>>
>> _______________________________________________
>> Pd-list at iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
--
Jaime E Oliver LR
joliverl at ucsd.edu
www.realidadvisual.org/jaimeoliver
www-crca.ucsd.edu/
www.realidadvisual.org
858 202 1522
9168 Regents Rd. Apt. G
La Jolla, CA 92037
USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090707/7bcaa847/attachment.htm>
More information about the Pd-list
mailing list