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); }
/// <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)); }
public static MathVector ScaleTs(this IMathVector a, double b) { return((MathVector)a.Scale(b)); }