/// <summary> /// Returns the point midway between two points. /// </summary> /// <param name="a">The first point.</param> /// <param name="b">The second point.</param> /// <returns>The point (<paramref name="a"/> + <paramref name="b"/>)/2.</returns> public static Point MidPoint(PointSet a, PointSet b) { if (!a.isRegular || !b.isRegular) { throw (new PointNotRegularException()); } return(((a.ToVector() + b.ToVector()) / 2).ToPoint()); }
/// <summary> /// Returns the point midway between two points. /// </summary> /// <param name="a">The first point.</param> /// <param name="b">The second point.</param> /// <returns>The point (<paramref name="a"/> + <paramref name="b"/>)/2.</returns> public static Point MidPoint(PointSet a, PointSet b) { if (!a.isRegular || !b.isRegular) { throw (new PointNotRegularException()); } return ((a.ToVector() + b.ToVector()) / 2).ToPoint(); }
/// <summary> /// Adds a point and a vector to produce a new point. /// </summary> /// <param name="a">A point.</param> /// <param name="b">A vector.</param> /// <returns>The point <paramref name="a"/> + <paramref name="b"/>.</returns> public static Point Add(PointSet a, Vector b) { return(Vector.Add(a.ToVector(), b).ToPoint()); }
/// <summary> /// Adds a point and a vector to produce a new point. /// </summary> /// <param name="a">A point.</param> /// <param name="b">A vector.</param> /// <returns>The point <paramref name="a"/> + <paramref name="b"/>.</returns> public static Point Add(PointSet a, Vector b) { return Vector.Add(a.ToVector(), b).ToPoint(); }