result = (p.x2 == origin.x2);
else result = (p.x2 == origin.x2);
    public boolean lies(PlanePoint p)    {        if (p == null) throw new NullPointerException("No point.");        boolean result = false;        double k1, k2;        if (direction.x1 == 0 && direction.x2 !=0) {            k2 = (p.x2-origin.x2)/direction.x2;            if (k2 < 0 || k2 > 1) result = false;            else result = (p.x1 == origin.x1);        } else if (direction.x1 != 0 && direction.x2 ==0) {            k1 = (p.x1-origin.x1)/direction.x1;            if (k1 < 0 || k1 > 1) result = false;            result = (p.x2 == origin.x2);        } else if (direction.x1 != 0 && direction.x2 !=0) {            k1 = (p.x1-origin.x1)/direction.x1;            k2 = (p.x2-origin.x2)/direction.x2;            if (k1 == k2) {                if (k1 < 0 || k1 > 1) result = false;                else result = true;            }        }        return result;    }