Multi-touch gear for navigation

Hello to everyone,

I’m a student and not very expert in coding but I’m trying to experiment with touchscreens using the smartphone’s screen as prototype, using conductive objects as interactive gears.

I’d like to put on the screen a three-point of contact object, where each point is positioned as if they where on each of an isosceles triangle’s vertices.
When I rotate the tool, something should happen, like scrolling a page or something.

Now, as a first step I think I should define an orientation, that’s why I thought of an isosceles triangle (acute), so I need to find the apex.

I think I should calculate the sides to find the longer, so I thought about calculating point distances.
Should I calculate the major sides, confronting each distances?
Am I in the right direction?

The next problem is to keep the apex tracked when rotating the object, to have the orientation and tracking the angle of rotation.
What could I use to track the angle of rotation?

Do you have some clues on the algorithm?

thank you in advance,


Maybe this link could be a starting point.
Edit: I forgot to link the reference.