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