how to calculate the midpoint of a segment?
The midpoint is the point on the segment halfway between the endpoints. It may be the case that the midpoint of a segment can be found simply by counting. If the segment is horizontal or vertical, you can find the midpoint by dividing the length of the segment by 2 and counting that value from either of the endpoints.