hi,i have just working on kinect and c# programming so i am very amateur at it
i liked to know about joint angles
i created this code just to test me skill without using kinect
but em having trouble with this code
i supposed vector3 v1 and vector3 v2 as a joint replacement
but the value return from Find_angle is 'nan'
am i missing something in the process
please any help in this regard will b helpful
Vector3 V1 = new Vector3(100,40,90);
Vector3 v2 = new Vector3(160,60,90);
public MainWindow()
{
InitializeComponent();
Vector3.Normalize(V1);
Vector3.Normalize(v2);
float Result = this.find_angle(V1,v2);
MessageBox.Show(Result.ToString());
}
public float find_angle(Vector3 va, Vector3 vb)
{
float dot_pro=Vector3.Dot(va, vb);
double angle = Math.Acos(dot_pro);
angle = angle * 180 / Math.PI;
return (float)(angle);
}