Can I define a plane given 2 points in xyz coordinates as well as roll angle about that vector? I am working on a complex motion analysis, trying to calculate wrist angles in 3 dimensions. I have sensors placed as this diagram depicts

and need both flexion/extension angles as well as radial/ulnar deviation angles. The sensors provide xyz coordinates as well as yaw, pitch & roll angles in degrees.
The problem is, the forearm is unconstrained and can rotate freely so the reference plane is constantly changing. I would like to define a plane based on the vector formed by sensors 2 & 3 and the roll angle about that vector (sensors 2 & 3 are mounted to a plate so they should automatically be in the same plane). I would then like to project the point at sensor 1 onto the plane defined in the previous step in order to find the radio-ulnar deviation angles as separate from flexion/extension. Is this possible or do I need a 3rd point on the arm in order to define the plane of the forearm?
I currently have the flexion/extension angle calculated as the arccosine of the dot product of the 2 vectors. See image with my formula in the bar at top 
Is this part correct? 
Thank you for any suggestions or guidance you can provide.
 A: You can't distinguish flexion/extension from radio-ulnar deviation unless you can calibrate your setup somehow. You can easily convert coordinates to some reference system which moves with the plate on which sensors 2 and 3 are mounted, but you don't know the plane of that plate a priori. The arccos computation you describe would be the total angle between the two lines, which includes both the angles you are looking for.
If you can calibrate the system, then you can use the following approach:
Given yaw/pitch/roll of sensor 2 or sensor 3, find a rotation matrix which undoes these rotations, or in other terms a change of coordinates to the reference frame of this sensor. The exact way to form that rotation matrix depends on the order and reference frame of your rotation angles, there are various conflicting conventions so you have to see which numbers your devices actually report. For a rotation matrix, the inverse is simply the transpose, so inverting that matrix is cheap. Since both sensors are mounted on the same plate, they should only be able to rotate together, so it doesn't matter which of the two rotations you take, since the results should only differ by some constant rotation anyway. I intend to use this to orient the reference coordinate system, and I'll not be using the rotations of sensor 1 at all.
In the next step, take the difference vectors from 2 to 1 resp. from 2 to 3. These are the positions in a reference frame which has sensor 2 at the origin. Apply the rotation-undoing matrix from the previous paragraph, and you obtain a reference frame in which the plane of your forarm plate has a fixed position.
What that position is you'll have to find out during calibration. There are two important planes, corresponding to your two different angles. These two planes are orthogonal to one another, and both contain the line joining sensors 2 and 3 (or more precisely the arm below those sensors). Move the hand in one direction, and you know your planes with respect to this reference frame. Knowing a plane through the origin can often best be described by writing down its normal vector. And computing a vector normal to two given vectors is easiest done using the cross product. For later use, it makes sense to normalize these normal vectors to unit length.
Now you want to track motion. For every frame of your data, do the above translation and rotation to get to a coordinate system fixed with respect to the forearm. Then compute the dot product between the vector pointing at sensor 1, normalized to unit length, and the unit length normal vector of one of your planes. The result will be the sine of the angle that the line joining sensors 1 and 2 makes with the plane. Doing so for two planes will give you the two angles you're asking about.
Mathematicians tend to write things down in two dimensions, or using rather abstract notation. Neither is readily available for you in Excel. So I suggest you do the computation symbolically on a sheet of paper, and give every variable of every intermediate step a unique name. This will mean nine names for a rotation matrix, three for a vector, and so on. Once you have worked out all the formulas, you can assign those names to the columns in your Excel table, and write the formula for every single number in a single row. That you can then copy to the other rows.
