finding the rotational relationship between two tracking markers (Math Question)

It’s a little hard to explain so I’ll start with a screenshot of my node-setup:



As you can see I have the X and Y positions of two tracking markers…what I’m trying to do is use these values to find the change in rotation between the two tracking points(or the change in rotation of my camera when filming). I’m assuming you’d use the math nodes to combine them, but I have no clue which operation to use plus if I should check the “clamp” check box or not.

The outputting value will be applied to a still image(this image also has the location from one of the tackers applied to it as well).

Any and all help would be greatly appreciated!

You know that there is a rotation solver in the tracker right? In 2D stabiliser panel add a track, then add a rotation track. In nodes the Movie Clip node will have a rotational value to use. If you dont want to use it for stabilsing then invert it with a math node multiply -1

Of-course 3pointEdit is right, you don’t have to do all this math. However if for any reason you’d anyway want to do it manually, you could try setup below.


There’s one thing to note though:
Angles are described in radians. This may be misleading as in “rotate” node it may seem that degrees are expected.

If you enter the value manually - yes, you use degrees, but if you plug anything into the socket for angle - it’s assumed that radians are used.
You can try to do a little test:
Compare such two setups:


As you can see we have different outputs, although logically it may seem that they should be the same.
It’s not true because when you enter value directly in the node, you enter degrees that are in the node itself converted to radians.
When you connect the value as an external input (lower setup) the node assumes that you give radians.
Outputs are different because 45 degrees doesn’t equal 45 radians.

That’s why the first setup I showed works. All calculations made in “math” nodes use radians as the angle unit.

Thank you very much for both of your quick responses!

Oh cool Bartek, that’s an awesome break down I didn’t think this could be done without using constraints in 3d space. Should make it a preset group!