How do I graph straight lines in Socratic?

How can I graph straight lines in Socratic graphing utility?

By straight lines I mean functions like #y=a# and #x=a# for real values of #a#.

1 Answer
Jan 26, 2018

Play around with the value of the slope.

Explanation:

You can find an explanation of how to graph vertical lines in this Socratic answer.

The same approach can be used to graph horizontal lines, only this time, the slope must be a really small number. For example, you can go with #0.001# as a slope and graph the line

#y = 3#

by writing

y = 0.001x + 3 #" "# or simply #" "# 0.001x + 3

in the graphing utility.

graph{y = 0.001x + 3 [-10, 10, -5, 5]}

To graph

#y = -3#

you can write

y = 0.001x - 3 #" "# or simply #" "# 0.001x - 3

graph{y = 0.001x - 3 [-10, 10, -5, 5]}

Not ideal, but it gets the job done.

#color(white)(a/a)#
ADDENDUM

As it turns out, you can graph a horizontal line by using zero as the slope. This wasn't possible a while ago--or at least that's what I remember--but you can do it now.

So to graph

#y = -3#

you can write

y = 0x - 3 #" "# or simply #" "# 0x - 3

graph{y=0x-3 [-10, 10, -5, 5]}