A lot of trigonometry.
Two points define a line y=ax + b y=mx+n y-y1=m(x-x1)
Then you can find if they intercept the robot.
For example, using y-y1=m(x-x1) I think if X and X1 are negative it will be an impossible linear move because you are going through the robot
Well I didn't try any trigonometry and it may be useful for some situations but in this case the problem isn't going through the robot. I'm always working on the same side of the robot.
I basically work in a cubic box of 200mm x 200mm x 200mm on one side of the robot. Problem is while I can reach for example point (100,100,100) with a linear move with the initial TCP orientation, when I later change the orientation a bit (for example 30 degrees in W), then there are points I'm not able to reach anymore by linear moving.
Despite not being able to reach them, the CHECK_EPOS doesn't give status <> 0 so the robot tries to move there and then gives the MOTN-018 Position not reachable (G:1) or the SRVO-115 Limit error (G:1, A:6) which makes you have to reset the program on the teachpendant which is not acceptable for my application