Solver To find midpoint of segment connecting two point
Algebra
->
Points-lines-and-rays
-> Solver To find midpoint of segment connecting two point
Log On
Geometry: Points, lines, angles, perimeter
Geometry
Solvers
Solvers
Lessons
Lessons
Answers archive
Answers
Source code of 'To find midpoint of segment connecting two point'
This Solver (To find midpoint of segment connecting two point)
was created by by
chillaks(0)
:
View Source
,
Show
,
Put on YOUR site
About chillaks
:
am a freelancer
==section input The coordinates of two points are X1= *[input x1=3], Y1= *[input y1=6] X2=*[input x2=4] , Y2=*[input y2=5] Find the coordinates of mid point of segment joining these two points. ==section solution perl my $midx=($x1+$x2)/2; my $midy=($y1+$y2)/2; print " The <A HREF=http://www.algebra.com/algebra/about/history/Coordinates-%2528mathematics%2529.wikipedia>Coordinates</A> of mid point of a <A HREF=line-ray-and-segments.lesson>line segment</A> joining two points can be calculated using following formulas. <b>X coordinate of mid point is</b> {{{X[mid]= (X coordinate_of_first_point + X coordinate_of_first_point)/2}}} {{{X[mid] =($x1+$x2)/2}}} {{{X[mid] =($x1+$x2)/2=$midx}}} <b>Y coordinate of mid point is</b> {{{Y[mid]= (Y coordinate_of_first_point + Y coordinate_of_first_point)/2}}} {{{Y[mid] =($y1+$y2)/2}}} {{{Y[mid]=($y1+$y2)/2=$midy}}} Hence, The mid point of segment joining two point ($x1,$y1) and ($x2,$y2) is ($midx,$midy) " ; ==section output midx, ==section check x1=2 y1=2 x2=3 y3=3 midx=2.5