<!doctypehtml><title>
   Line Segment Definition  - Math Open Reference
  </title><meta content="text/html; charset=utf-8"http-equiv=content-type><meta content=segment,line name=Keywords><meta content="Definition of a line segment, a line linking two points."name=Description><meta content="line segment"name=wp><link href=common/css2.css rel=stylesheet><script src=common/js6.js></script><meta content=width=device-width,initial-scale=1 name=viewport><script src=//cdn.thisiswaldo.com/static/js/9075.js></script><body><style>#nav1  {
	position:fixed;
	top:0; 
	left:1%;
	background: #6789ab;
	height: 36px;
	width: 98%;
	max-width: 728px;
	z-index:9000;
}

	#nav1 #logo {
		float:left;
		letter-spacing:1px;
		font-size:20px;
		font-weight:bold;
		color:white;
		margin:	8px 0 0	20px;
		cursor:pointer;
	}


#nav2	{
	position:fixed;
	top:36px;
	left:1%;
	background: #666;
	height: 42px;
	max-width: 728px;
	width:98%;
	padding:9px 0 0 20px;
	z-index:9000
}



	#nav2 #srch {
		width:240px;
		height: 22px;
		border: 2px solid #a98;
		padding-left:5px;
		font-size:16px;
		font-family:sans-serif;
		border-radius:	6px 0 0	6px
	}

	#nav2 #srch:focus {
		outline: none;
	}

	#nav2 #srchIcon	{
		float:left;
		width:30px;
		position:relative;
		height:22px;
		background:#a98;
		border-radius: 0 6px 6px 0;
		cursor:pointer;
	}

	#nav2 .search.icon {
		color: #000;
		position: absolute;
		top: 3px;
		left:5px;
		width: 14px;
		height: 14px;
		border: solid 1px white;
		border-radius: 100%;
		-webkit-transform: rotate(-45deg);
		transform: rotate(-45deg);
	}

	#nav2 .search.icon:before {
		content: '';
		position: absolute;
		top: 11px;
		left: 4px;
		height: 10px;
		width: 2px;
		background-color: white;
		}



#nav3	{
	position:fixed;
	top:78px;
	left:1%;
	background:#a98;
	height:36px;
	width:98%;
	max-width: 728px;
	padding-top:4px;
	z-index:9000
}

	#nav3 .navLink	{
		color:white;
		margin:4px 14px 0 12px ;
		float:left;
		cursor:pointer
	}


@media print {
		body {
		margin-top: 50px
		}

		#nav1,#nav2,#nav3 {
		display:none
		}
}</style><div id=nav1><a href=index.html id=logo title=Home> Math Open Reference </a></div><div id=nav2><form action=search.php id=searchForm method=post onsubmit=goSearch();><input id=srch name=srch style=float:left><input id=dbug name=dbug type=hidden value=normal><div id=srchIcon onclick=goSearch()><div class="search icon"title=Search></div></div></form></div><div id=nav3><a class=navLink href=index.html> Home </a><a class=navLink href=sitecontacts.php> Contact </a><a class=navLink href=siteabout.html> About </a><a class=navLink href=indexpagea.html> Subject Index </a></div><style>.leftSideBar  {      
        display:none;
	position:fixed; 
	top: 50px; 
	left:5px; 
	width:160px; 
	height:200px;
	border:1px solid pink;
}

/*desktop devices only*/
@media only screen and (min-device-width: 480px)	
  {	
     body {
	margin-left:220px;
     }

     .leftSideBar  { 
     	display:block;
     }

     #nav1, #nav2, #nav3 {
     left: 220px;
     width:600px;
     }

  }</style><div class=leftSideBar><div style="width:160px; height:600px;  border:1px solid #aaa; background:#f6f6f6;"><div id=waldo-tag-9354></div></div></div><h1>Line Segment</h1><div class=gDefinition>Definition: A straight line which links two <a title="A precise location or place on a plane"href=point.html> points </a> without extending beyond them.</div><div class=gAppletHint><span class=gTrythis> Try this </span> Adjust the line segment below by dragging an orange dot on an endpoint and see how the segment PQ behaves.</div><center> <div class=applet id=applet><script language=javascript>loadJSApplet("linesegment", "applet", 600, 300,"appletframe");</script></div> </center><p>See the figure above. The line segment PQ links the <a title="A precise location or place on a plane"href=point.html> points </a> P and Q. The points P and Q are called the 'endpoints' of the segment. The word 'segment' typically means 'a piece' of something, and here it means the piece of a full <a title="A geometrical object that is straight, infinitely long and infinitely thin"href=line.html> line </a> , which would normally extend to infinity in both directions.<p>A line segment is one-dimensional. It has a measurable length, but has zero width. If you draw a line segment with a pencil, examination with a microscope would show that the pencil mark has a measurable width. The pencil line is just a way to illustrate the idea on paper. In geometry however, a line segment has no width.<h2>Naming of line segments</h2> Line segments are commonly named in two ways: <ol><li class=spacedlist>By the endpoints. <br> In the figure above, the line segment would be called PQ because it links the two points P and Q. Recall that points are usually labelled with single upper-case (capital) letters. A shorthand way of writing this is <img alt border=0 class=soloEqn height=22 src=images/linesegment/symbol.gif width=37> This is read as "line segment PQ".  The bar over the two letters indicates it is a line segment, rather than a line, which goes on forever in both directions.<li class=spacedlist>By a single letter. <br> The segment above would be called simply "y". By convention, this is usually a single lower case (small) letter. This method is often used in the naming the sides of <a title="figure with three sides which are straight line segments"href=triangle.html> triangles </a> and other <a title="line segments, each connected end to end to form a closed shape"href=polygon.html> polygons </a> .</ol><div style="width:300px; height:250px; margin: 20px auto; border:1px solid #888; background:#eee;"><div id=waldo-tag-9113></div></div><h2>Constructions</h2> In the <a title="The drawing of various shapes using only a compass a straightedge"href=constructions.html> constructions </a> chapter, there are animated demonstrations of how to perform various constructions related to line segments using only a compass and straightedge. See: <br><br><ul><li><a href=constcopysegment.html> Copying a Line Segment </a> .<li><a href=constdividesegment.html> Dividing a line segment into n equal parts </a><li><a href=constbisectline.html> Constructing a perpendicular bisector of a line segment </a></ul><h2>Coordinate Geometry</h2><p>In another branch of mathematics called coordinate geometry, the points that define a line are located on the plane using their coordinates - two numbers that show where the point is positioned. <br> For more on this, see <a href=coordsegment.html> Definition of a Line Segment (Coordinate Geometry) </a> .<p>If we know the coordinates of the two endpoints of a line segment, we can calculate the distance between them, and so find the length of the line segment. See <a href=coorddist.html> Distance between two points (coordinate geometry) </a><div style="width:300px; height:250px; margin: 20px auto; border:1px solid #888; background:#eee;"><div id=waldo-tag-9111></div></div><h2>Other line topics</h2><ul class=citeUL><li><a class=gSeeAlso href=point.html> Point definition </a><li><a class=gSeeAlso href=line.html> Line definition </a><li><a class=gSeeAlso href=vertical.html> Vertical lines </a><li><a class=gSeeAlso href=horizontal.html> Horizontal lines </a><li><a class=gSeeAlso href=linesegment.html> Line segment </a><li><a class=gSeeAlso href=midpoint.html> Midpoint of a line </a><li><a class=gSeeAlso href=ray.html> Ray </a><li><a class=gSeeAlso href=angle.html> Angle </a><li><a class=gSeeAlso href=oppositerays.html> Opposite rays </a><li><a class=gSeeAlso href=intersection.html> Intersection </a><li><a class=gSeeAlso href=parallel.html> Parallel lines </a><li><a class=gSeeAlso href=transversal.html> Transversal </a><li><a class=gSeeAlso href=bisectorline.html> Line bisector </a><li><a class=gSeeAlso href=bisectorperpendicular.html> Perpendicular bisector </a><li><a class=gSeeAlso href=coplanar.html> Coplanar </a><li><a class=gSeeAlso href=collinear.html> Collinear points </a><li><a class=gSeeAlso href=plane.html> Plane </a></ul><div style="width:300px; height:250px; margin: 20px auto; border:1px solid #888; background:#eee;"><div id=waldo-tag-9112></div></div><form action=/site/contacts.php id=feedback method=post><input class=fbInput1 id=refpage name=refpage type=hidden></form><div class=legal>(C) 2011 Copyright Math Open Reference. <br> All rights reserved</div><style>.rightCol  {            /* overrides css2.css */
	position:fixed; 
	top: 20px; 
	left:875px; 
	width:300px; 
}</style><div class=rightCol><div style="width:300px; height:250px; margin: 20px auto; border:1px solid #bbb; background:#efefef;"><div id=waldo-tag-9180></div></div><div style="width:300px; height:250px; margin: 20px auto;"><div id=waldo-tag-9325><script>googletag.cmd.push(function() { googletag.display('waldo-tag-9325'); });</script></div></div></div><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-88697705-1', 'auto');
  ga('send', 'pageview');</script><script><!-- @@include linesegment.js  -->
initApplet();
csr = new Cursor();
buttonBar = new ButtonStrip(applet);

 


var drawArea = new Sprite();
var a        = new LabeledPoint(150,200,     VISIBLE,   DRAGGABLE, "P");  
var b        = new LabeledPoint(400,100,     VISIBLE,   DRAGGABLE, "Q");  
var segment  = new GeomLine(a,b);
var q        = new TextObj(0,0,"y");

  

function build() //called when the shared stuff has done loading
{ 	var msk =  makeMask(0,0,600,275); 
	drawArea.mask = msk;
	addChild(msk);
	addChild(drawArea);
	
	//add controls
	buttonBar.addCommands([resetCmd , printCmd, fullCmd, hideCmd]);
		  
	with(drawArea)
	  { //add children
	    addChild(segment);
		addChild(q);
	    addChild(a);	//add points last so on top
	    addChild(b);
	  }


	//set up Hint
	hint = new Hint(b, Hint.BELOWRT, "Drag any orange dot");
	addChild(hint);

    //set up for first time through only
	animation = "introPause"; 
	
    initVals();
	update();	
    
	//add event listener last.  Frame ticks now start going to animate().
	startTicking(1, animate);  //happens every frame 
}


function reset() //set up app ready for user interaction
{ 
  initVals();
  animation = "stopped";
  graphics.clear();
  update();
}


function initVals()
{ 
}


function update()
{ q.x = a.x + (b.x-a.x)/2;
  q.y = a.y - (a.y-b.y)/2;

  a.update();
  b.update();
  segment.update();
  q.update();

repaint();

}



function pointMoved(e)
{  if(pointBeingMoved == a)    
     {
	 }
	
  update();
}


  
function animStart()  //called when run button pressed
{ animation = "run";
}

function animStop()  //called when run button pressed
{ animation = "stopped";
}

var initVal;
var tgtVal;
var delta = -6;
function animate(event)  //call every frame tick - 30fps
{ 
  switch(animation)
	 { case "introPause": 
	        if(timeElapsed(500)) 
			   { animation="intro"; 
			     initVal = a.y;
				 tgtVal  = a.y - 140; 
			   }
			break;
			
	   case "intro":  
	        a.y+=delta;
	        update();
		    if(a.y <= tgtVal)
			   { animation="intro2a";
			   }
			break;
			
       case "intro2a": 
	        if(timeElapsed(500)) 
			   { animation="intro2"; 
			   }
			break;   
			
	   case "intro2": 
	        a.y -= delta;
			update();
		    if(a.y >= initVal)
			   { animation="hintPause";
			   }
			break;	
	
	   case "hintPause":
		    if(timeElapsed(500))
			  { animation="introdone";
			    Hint.show();
				reset(); 
				// intro animation done and app is reset,
				// ready for user interaction
			  }
			break;
	 
					  
        default: break;  
     }
}

build();</script><style>#neworFooter {
	display:none; /* we turn it back on selectively*/
}

@media screen and (max-device-width: 768px)  /* show if mobile, or              
              (min-height: 750px      )         any device if window tall enough */
  { #neworFooter {display:block;}
  }</style><div id=neworFooter><div id=waldo-tag-9108></div></div>