Posted in: ,
By Unknown 0 comments

Calculation dihedral angle from 2 vectors

計算acos的簡單範例,先用以下公式求出cos值,再利用acos得到角度





/* acos example */
#include <stdio.h>
#include <math.h>

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 0.5;
  result = acos (param) * 180.0 / PI;
  printf ("The arc cosine of %lf is %lf degrees.\n", param, result );
  return 0;
}

參考

Leave a Reply