in reply to Check if line is straight

Your question isn't very clear. A line is always "straight", so you're not asking about that, and you have only two points, and two points are always collinear. If you had three points, we could tell if they were all on the same straight line. So please refine your question a bit, and we can to help.

Update: I just saw LanX's response, prompting me to read the code. In fact, you have three points, so I suspect you're asking whether the points are all collinear. If so, his reply gives the solution...

...roboticus

When your only tool is a hammer, all problems look like your thumb.