コード例 #1
0
 public static MathPoint Project(this IMathPoint point, IMathPoint origin, IMathVector axis)
 {
     var a = (IMathVector) point.Subtract(origin);
     var t = a.Project(axis);
     var v = (MathVector) axis.Scale(t);
     return (MathPoint) origin.AddVector(v);
 }
コード例 #2
0
        /// <summary>
        /// 计算在某轴上的投影
        /// </summary>
        /// <param name="point"></param>
        /// <param name="origin"></param>
        /// <param name="axis"></param>
        /// <returns></returns>
        public static MathPoint Project(this IMathPoint point, IMathPoint origin, IMathVector axis)
        {
            var a = (IMathVector)point.Subtract(origin);
            var t = a.Project(axis);
            var v = (MathVector)axis.Scale(t);

            return((MathPoint)origin.AddVector(v));
        }
コード例 #3
0
 public static MathVector ScaleTs(this IMathVector a, double b)
 {
     return((MathVector)a.Scale(b));
 }