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?
 A: 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.
A: 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.
A: In your example, the equation of a line passing from $(3,1)$ and $(7,2)$ is $$y=\frac{1}{4}x+\frac{1}{4}$$
defined for $3<x<7$ and $1<y<2$
Now let's take $3<x<7$  and split it into two inequalities $$3<x$$ and $$x<7$$, or equivalently $$x-3>0$$ and $$7-x>0$$
Now write $$\sqrt{\frac{|7-x|}{7-x}}$$ and  $$\sqrt{\frac{|x-3|}{x-3}}$$
Notice that in $$\sqrt{\frac{|7-x|}{7-x}}$$ if I plug in a value greater than $7$ the I get a complex number, this is why I included the square root, similarly   $$\sqrt{\frac{|x-3|}{x-3}}$$ becomes complex number for values of $x$ less than $3$ (note that the purpose of the absolute values is to "normalize" the term so that the only possible values that I can get are $-1$ or $1$)
Next multiply  $$\sqrt{\frac{|7-x|}{7-x}}$$ and  $$\sqrt{\frac{|x-3|}{x-3}}$$ together and multiply with $x$ in the equation of the line to get $$y=\frac{1}{4} x \sqrt{\frac{|7-x|}{7-x}} \sqrt{\frac{|x-3|}{x-3}}+\frac{1}{4}$$
and this equation describes a line segment if you include the points $(3,1)$ and $(7,2)$
This method will work for any curve.
A: 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.
