Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="p0"></param>
        /// <param name="p1"></param>
        /// <param name="p2"></param>
        /// <returns></returns>
        public static Vector3d GetIncenter(Vector3d p0, Vector3d p1, Vector3d p2)
        {
            double d01      = p0.DistanceTo(p1);
            double d12      = p1.DistanceTo(p2);
            double d20      = p2.DistanceTo(p0);
            double perimInv = 1.0 / (d01 + d12 + d20); // inverse perimeter

            return(p0 * (d12 * perimInv) + p1 * (d20 * perimInv) + p2 * (d01 * perimInv));
        }