/// <summary> /// sin(n)*r の整数部を返す。n:0-511で一周。(小数部丸めあり)。 /// </summary> /// <param name="n"></param> /// <param name="r"></param> /// <returns></returns> public int Sin(int n, int r) { int l = (int)(Round.RShift((long)Sin(n) * r, 16)); return(l); }
/// <summary> /// cos(n)*r の整数部を返す。n:0-511で一周。(小数部丸めあり)。 /// </summary> /// <param name="n"></param> /// <param name="r"></param> /// <returns></returns> public int Cos(int n, int r) { int l = (int)(Round.RShift((long)Cos(n) * r, 16)); return(l); }