Exemplo n.º 1
0
        // CGVector pointing in the same direction as self, with a length of 1.0 - or nil if the length is zero.
        public static CGVector?Normalize(this CGVector self)
        {
            var quadrance = self.Quadrance();

            return((quadrance > 0) ? self.Divide(NMath.Sqrt(quadrance)) : (CGVector?)null);
        }