역삼각함수 |

sin그래프 |


cosin 그래프 |


actangent 그래프 |


void FixedUpdate(){
Vector2 vel = GetComponent<Rigidbody2D>().velocity;
Vector2 dir = vel.normalized;
float degree = Mathf.Atan(dir.y/dir.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler (0, 0, degree);
}
참조 : sseong님 블로그
참조 : 수포자를 위한 게임수학 탄젠트
반응형