Thank you Joe.
it was so helpful. i got to study linear algebra and so on again..
if (arm.isValid()){
//basis
Leap::Matrix basis = arm.basis();
Leap::Vector xBasisArm = basis.xBasis;
Leap::Vector zBasisArm = basis.zBasis.operator*(-1);
//angle1
Leap::Vector hand_zBasis = handTransform.zBasis.operator*(-1);
//angle2
const Vector armV = arm.direction();
float wristAngle = zBasisArm.angleTo(hand_zBasis) * RAD_TO_DEG;
float wristAngle2 = hand.direction().angleTo(armV) * RAD_TO_DEG;
//Find sign
Vector crossWrist = zBasisArm.cross(hand_zBasis);
if (hand.isLeft()) xBasisArm = xBasisArm.operator*(-1);
int sign = (crossWrist.dot(xBasisArm) >= 0) ? 1 : -1;
wristAngle = sign*wristAngle;
wristAngle2 = sign*wristAngle2;
if i add one more, test result shows me that the direction vector is more accurate than using basis. i don't know why but practical results shows it.
Thank you very much.