using UnityEngine;
namespace R0bbie.VRSubtitles
{
///
/// Some useful Math functions
///
public class Math
{
///
///
///
///
///
///
///
public static float SignedAngleBetween(Vector3 a, Vector3 b, Vector3 n)
{
// angle in [0,180]
float angle = Vector3.Angle(a,b);
float sign = Mathf.Sign(Vector3.Dot(n,Vector3.Cross(a,b)));
// angle in [-179,180]
float signed_angle = angle * sign;
return signed_angle;
}
}
}