public StraightLine(Point2F p1, Point2F p2) { float a = p1.Y - p2.Y, b = p2.X - p1.X; a_ = a; b_ = b; c_ = -(a * p1.X + b * p1.Y); xInterval_ = new IntervalF(p1.X, p2.X); yInterval_ = new IntervalF(p1.Y, p2.Y); }
public bool IsOverlap(Point2F p) { return a_ * p.X + b_ * p.Y + c_ == 0 && xInterval_.InRange(p.X) && yInterval_.InRange(p.Y); }
public Vector2F(Point2F to, Point2F from) { X = to.X - from.X; Y = to.Y - from.Y; }
public Vector2F(Point2F p) { X = p.X; Y = p.Y; }
public Point2F Offset(Point2F dp) { return new Point2F(X + dp.X, Y + dp.Y); }
public bool Equals(Point2F p) { return p.X == X && p.Y == Y; }