# Calculating angle of human joint beyond 180° in 3D

I'm having some trouble calculating the angle of an human joint in 3D using the Microsoft Kinect.

Here's an example of the angle of the elbow (using the shoulder and wrist joint):

Image of example

Calculating angles between 0° and 180° is no problem, but when the person hyperextends his elbow my calculation returns 170° instead of 190°.

The calculation I'm using is as follows:

1. $d = b - a$
2. $e = b - c$

Where a, b and c are 3D-points and d and e are 3D-vectors.

My question is: How can I calculate the angle between $d$ en $e$ where the angle is between 0° and 360°?

-
What exactly are $a, b, c, d$ and $e$? –  Daan Michiels May 3 '12 at 11:12
@Daan Michiels: $a$, $b$ and $c$ are 3D-points. $d$ and $e$ are 3D-vectors. –  Jeroen Corsius May 3 '12 at 11:17
I am doing the same task, can you provide some example project? –  Ewerton Nov 7 '12 at 22:32