41 u_(
p[0],
p[1]), v_(
q[0],
q[1])
45 bool Line2D::isCrossing(Line2D& other)
47 const float d = ((v_[0] - u_[0]) * (other.v_[1] - other.u_[1])
48 - (v_[1] - u_[1]) * (other.v_[0] - other.u_[0]));
52 const float u = ((other.u_[0] - u_[0])*(other.v_[1] - other.u_[1])
53 - (other.u_[1] - u_[1])*(other.v_[0] - other.u_[0]))/d;
54 const float v = ((other.u_[0] - u_[0])*(v_[1] - u_[1])
55 - (other.u_[1] - u_[1])*(v_[0] - u_[0]))/d;
56 if (u < 0.0 || u > 1.0) {
59 if (v < 0.0 || v > 1.0) {