[PD] rotating coordinate system
Achim Bornhoeft
achim at bornhoeft.org
Tue Jul 7 22:41:15 CEST 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coord-rotate-test.pd
Type: application/octet-stream
Size: 3612 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090707/c748ef47/attachment.obj>
-------------- next part --------------
> Ciao
> --
> Frank
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
More information about the Pd-list
mailing list