How can I tell if a line is vertical?

I’m writing an activity where I need one thing to happen if students enter a vertical line (e.g., x = 3) and a different thing to happen if students enter a non-vertical line.

How can I tell if a line is vertical?

I tried using slopeOfLine(xyLine(c2input.latex)) but it turns out that the slope of something like x = 3 is “defined” as infinity, so that approach didn’t work.

Any ideas?

A quick chat with Denis revealed the answer: Use isVertical.

Here it is in the docs

Also, just fyi, you can use these as:

xyLine("y=x").slope
xyLine("y=x").isVertical

The slopeOfLine function will still work, but it is deprecated as we moved things to be methods of the xyLine object to make it easy to see what’s possible by typing a . after an xyLine object.