예제 #1
0
    //translated from UnityEngine
    /// Returns the signed angle between two vectors in radians
    public static float angle(float3 from, float3 to)
    {
        var num = (from.lengthsq() * to.lengthsq()).sqrt();

        return(num < 1.00000000362749E-15f ? 0 : (math.dot(from, to) / num).npsaturate().acos());   // * 57.29578f;
    }
예제 #2
0
 public static float fastangle(float3 from, float3 to) => (math.dot(from, to) / (from.lengthsq() * to.lengthsq()).fastsqrt()).npsaturate().acos();