Mid Point Of Line Segment - CSharp System

CSharp examples for System:Math Geometry

Description

Mid Point Of Line Segment

Demo Code


using System.Windows.Media;
using System.Windows;
using System;/*from   ww w  .j  ava2 s. co  m*/

public class Main{
        public static Point MidPointOfLineSegment(Point point1, Point point2)
        {
            return new Point(Math.Round((point1.X + point2.X) / 2), Math.Round((point1.Y + point2.Y) / 2));
        }
}

Related Tutorials