示例#1
0
 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);
 }
示例#2
0
 public bool IsOverlap(Point2F p)
 {
     return a_ * p.X + b_ * p.Y + c_ == 0 &&
            xInterval_.InRange(p.X) && yInterval_.InRange(p.Y);
 }
示例#3
0
 public Vector2F(Point2F to, Point2F from)
 {
     X = to.X - from.X;
     Y = to.Y - from.Y;
 }
示例#4
0
 public Vector2F(Point2F p)
 {
     X = p.X;
     Y = p.Y;
 }
示例#5
0
 public Point2F Offset(Point2F dp)
 {
     return new Point2F(X + dp.X, Y + dp.Y);
 }
示例#6
0
 public bool Equals(Point2F p)
 {
     return p.X == X && p.Y == Y;
 }