![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Wacom (X,Y) Coordinates to Circular Coordinates (R; Theta) |
Sylvain KEPLER Member |
![]() ![]() ![]() Hey ![]() I'm about to process the X,Y coordinates from the Wacom Intuos, in order to get from these the actual pen angular position . At this stage I moved the circle 's 'center' in the middle by applying the '-0.5' operator to the !PenX en !PenY. Very Simple. Then, I calculate the radius by doing r = (X²+Y²)sqrt. So the theta angle is supposed to be the result of an arcTan operation. However, here is my problem, I can't do such thing as asking the arcTan operation applied to that expression. It seems the arcTan only accepts dealing with constant values, but rejects dealing with variables. ("there is an error in one of the parameters being edited. Would you like to close the sound edited anyway and drops the changes to its parameters ?"...) Any help ? PS : my following goal will be screening the angle for comparaison operations in order to create misc operations (according the Pen position around the imaginary circle centre, that's why screening the angle is my wish). Thanks in advance. [This message has been edited by Sylvain KEPLER (edited 06 August 2005).] IP: Logged |
SSC Administrator |
![]() ![]() ![]() There is an ArcTan Sound that you could use by feeding a Constant with your X and Y values into it. Also, you could use !PenAngle and !PenRadius which has those calculations already done for you. [This message has been edited by SSC (edited 06 August 2005).] IP: Logged |
tuscland Member |
![]() ![]() ![]() Salut Sylvain ! At page 327, in the "Kyma X Revealed" manual, you can send the message "theta" and "r" to a Point (the notation is X@Y) to get the values you want. code:angle := (X@Y) theta. Et voilà ! PS : je suis aussi français ;-) [This message has been edited by tuscland (edited 07 August 2005).] [This message has been edited by tuscland (edited 07 August 2005).] IP: Logged |
Sylvain KEPLER Member |
![]() ![]() ![]() You know what ? I'm happy ![]() That's the magic of kyma. I had forgot the arcTan was available as a protoype. I'm that kind of guy who, sometimes, live on clouds and like to create a world of his own..;-) IP: Logged |
Sylvain KEPLER Member |
![]() ![]() ![]() The ArcTan Protoype is welcome in my current sound design. Saved...but The prototype reference gives not enough info about what should be the input's nature, how scaled is the output (0-1 value or -1 to 1 value etc, in degrees, in radians ??)... well, as for the input, all that matters is a ratio. I tried the idea of using the !PenRadius and !PenAngle in my sound but they are somewhat (a bit to be honnest) useless. What I need to do actually is a rotation of the "0° reference", a bit like if I would rotate the intuos. To do this I need, for instance, to take the ratio !PenX/!PenY which gives the Tan of the angle (I need prior this to translate the X;Y origin to the center of the intuos). Then I need to calculate the ArcTan (thanks to the given prototype) of the ration X/Y. Then Add an angle (ie +30°) and then output the sinus or the cosinus of the global angle. IP: Logged |
SSC Administrator |
![]() ![]() ![]() To rotate the tablet, you could add an offset to the pen's angle, as follows: rotated x coordinate -- !PenRadius * (!PenAngle + (30 / 180)) normCos and rotated y coordinate -- !PenRadius * (!PenAngle + (30 / 180)) normSin Change the 30 to the desired number of degrees of rotation. IP: Logged |
Sylvain KEPLER Member |
![]() ![]() ![]() Nice idea ideed ! Many Thanks ! I tried it and it works...but (always a shadow in the frame ![]() Maybe, I assume, this may be caused by a personal lack of comprehension about how the normCos and normSin functions work. Maybe you could let me know about it ? I might also try to reach my goal by doing some sort of trigonometry with sinus and cosinus operations Since I need to add an anlge and since I have better results by operating with Sin and Cos...as we know , Cos(a+b) is CosaCosb - SinaSinb and Sin(a+b) is SinaCosb+SinbCosa...I'll let you know about how I get on with this other possibility. [This message has been edited by Sylvain KEPLER (edited 08 August 2005).] IP: Logged |
Sylvain KEPLER Member |
![]() ![]() ![]() ...news from the works... Well I actually reached the goal by manipulating on Cos and Sin as described above in my previous post. Despite this, I'd like to get your help on how astutely use the normCos and normSin functions. Could you ? Thanks for your help. IP: Logged |
SSC Administrator |
![]() ![]() ![]() x normCos = (pi * x) cos x normSin = (pi * x) sin They are convenient versions of the sinusoids that are periodic with period 2 instead of period 2 * pi (or 360 degrees). (!PenAngle is also periodic with period 2.) IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.