I=(S=Uno.Distance = function(){
}).prototype;

S.PointPoint = function(point1, point2)
{
    return Uno.Vector.Length(Uno.Float3.operator_Sub(point2, point1));
};

S.RayPoint = function(ray, point)
{
    var diff = Uno.Float3.operator_Sub(point, ray.Position);
    var mul = Uno.Vector.Dot(ray.Direction, diff);
    var cp = (mul > 0.0) ? Uno.Float3.operator_Add(ray.Position, Uno.Float3.operator_Mul_1(ray.Direction, mul)) : ray.Position;
    return Uno.Vector.Length(Uno.Float3.operator_Sub(cp, point));
};
