Obtaining the point at a certain percentage along a line segment
问题 I have a method that returns the mid point of a line segment as defined by two points; public static PointF GetMidPoint(PointF p1, PointF p2) { return new PointF((p1.X + p2.X) / 2, (p1.Y + p2.Y) / 2); } Which works exactly as expected. However, I now need to find an arbitrary percentage along the segment (say, 35%), which in principle should(?) be as easy as; public static PointF GetArbitaryPoint(PointF p1, PointF p2, double percentage) { return new PointF((p1.X + p2.X) / percentage, (p1.Y +