using Unity.Mathematics; using UnityEngine; namespace UVC.Util { /// /// 수학 관련 유틸리티 메소드를 제공하는 클래스입니다. /// public static class MathUtil { /// /// 중심점(`center`)을 기준으로 반지름(`radius`) 거리에서 각도(`angle`)에 해당하는 위치를 계산합니다. /// /// 회전의 중심점 /// 회전 반지름 /// 회전 각도 (0~360도) /// 계산된 위치를 나타내는 `Vector3` /// /// 다음은 `GetCircleLocationXY` 메소드를 사용하는 예제입니다: /// /// Vector3 center = new Vector3(0, 0, 0); /// float radius = 5f; /// float angle = 90f; /// Vector3 position = MathUtil.GetCircleLocationXY(center, radius, angle); /// Debug.Log(position); // 출력: (0.0, 5.0, 0.0) /// /// public static Vector3 GetCircleLocationXY(Vector3 center, float radius, float angle) { Vector3 pos = new Vector3(math.cos(angle * Mathf.Deg2Rad) * radius, math.sin(angle * Mathf.Deg2Rad) * radius, 0); return pos + center; } } }