i'm trying to implement a dimmer switch like component. Lets say i want to implement an ellipse, that, while im dragging on it, rotates around its centerpoint. The rotation should be with respect to the dragging and not a random angle. The Position of the ellipse should be fixed, so that there is no translation, only a rotation around its center.
Anyone ever achieved such an interaction? It drives me crazy. I know that i need to calculate the rotation angle while im dragging, but i cannot sovle it.
i'm pretty new to processing. I try to draw a sine curve between two points. That would be the first step. Afterwards i would like to dynamically change frequency and amplitude of the sine curve.
Lets say, i have two Points P(200, 100) and Q(300, 600). How can i connect these two point with a sine curve??
The position of the point will not stay constant. They will change with user interaction.
If anyone can help me, would be really nice. I'm getting crazy with this. I hope the attached image illustrates what im trying to achieve.