# What's the equation for a line segment?

I already know that the standard equation for a line is $y=mx+b$, but what if I want the line to have specific endpoints and not go on forever? For example, the equation for a line beginning at $(3, 1)$ and ending at $(7, 2)$. Can you help me?

What's the standard equation for this?

• $$\frac{x-3}{4}=\frac{y-1}{1}$$ $$x=4t+3 ,\quad y=t+1 ,\quad0\le t\le 1$$ – Behrouz Maleki Jun 20 '16 at 13:18
• Thats a line segment. You can write the equation of line, and then write inequalities or intervals like $x\in[3,7]$ or $y\in[1,2]$ to specify that it is a segment. – Max Payne Jun 20 '16 at 13:18
• could you explain more? i can't understand t parameter.. – Kambiz Kousheshy Jun 20 '16 at 14:03
• $$\frac{x-1}{4}=\frac{y-1}{1}=t\quad 0\le t\le1$$ – Behrouz Maleki Jun 20 '16 at 14:33
• Given two points, $p,q \in \mathbb R^n$, the line segment connecting $p$ and $q$ is the set of all convex combinations of $p$ and $q$ $$\{ \theta p + (1-\theta) q \mid \theta \in [0,1]\}$$ – Rodrigo de Azevedo Jul 3 '16 at 1:43

You can make a parametric equation: $$x=tx_1+(1-t)x_2$$ & $$y=ty_1+(1-t)y_2$$ where t$\in[0,1]$. It is the internal section formula of a line, where i replaced m and n with t.

• Well I imagine someone doesn't take this as a serious question, hence the $-1$ on the question also. If it's voted to close I'll delete my answer, but it's better than having another unanswered question added to the site – snulty Jun 20 '16 at 13:31
• thanks for reply.. could you explain more? i can't understand 't' parameter.. – Kambiz Kousheshy Jun 20 '16 at 14:05
• you probably would have studied about internal section formula $x=\frac{mx_1+nx_2}{m+n}$ and $y=\frac{my_1+ny_2}{m+n}$ ,we are just dividing the line segment in m:n. So here , $t=\frac{m}{m+n}$ – Mayank Deora Jun 20 '16 at 14:12
• @Bye_World ,i will take care – Mayank Deora Jun 20 '16 at 14:14
• Notice that $t$ can take any values between 0 and 1 (inclusive) for any values of $m$ and $n$ .For more information read this :-doubleroot.in/coordinate-geometry-basics-section-formula-theory – Mayank Deora Jun 20 '16 at 14:24

The equation of your line is $$y=\frac{1}{4}(x+1)$$

found from the slope formula $m=\frac{y_2-y_1}{x_2-x_1}$, and solving for $y=1$ while subbing in $x=3$.

If you want a line segment rather than an infinite line you can restrict the domain of the line, restrict the allowed $x$-values:

$$y=\frac{1}{4}(x+1) \text{ for } x \in[3,7]$$

This we can see that $x=3$ we get $y=1$ and for $x=7$ we get $y=2$, and by continuity, we get all the values in between on the line, but none outside the segment we specified.

You can make a line segment like this:

-sqrt(x)² gives a line with a negative slope for which if x is negative, the function is undefined.

you can limit the values of y by doing: sqrt(-sqrt(x)²)² this way you cannot have any negative y values in your graph. all you have to do now is move your graph around.

for example try: -sqrt(-sqrt(x-1)²+2)²+3

Try playing around with the function to get a feel on how it works.