Beispiel #1
0
        public RectF(string data)
        {
            int splitIdx = data.IndexOf(' ', data.IndexOf(' ') + 1);

            Point  = new Point2F(data.Substring(0, splitIdx));
            Extent = new Point2F(data.Substring(splitIdx));
        }
Beispiel #2
0
 internal RectF(InternalRectFStruct point2FStruct)
 {
     Point  = new Point2F(point2FStruct.pointX, point2FStruct.pointY);
     Extent = new Point2F(point2FStruct.extentX, point2FStruct.extentY);
 }
Beispiel #3
0
 public double GetDistanceToLine(Point2F start, Point2F end)
 {
     return(Math.Abs((end.Y - start.Y) * X - (end.X - start.X) * Y + end.X * start.Y - end.Y * start.X) /
            Math.Sqrt((end.Y - start.Y) * (end.Y - start.Y) + (end.X - start.X) * (end.X - start.X)));
 }
Beispiel #4
0
 public RectF(float pointX, float pointY, float extentX, float extentY)
 {
     Point  = new Point2F(pointX, pointY);
     Extent = new Point2F(extentX, extentY);
 }
Beispiel #5
0
 /**
  * Distance from point p1 to p2
  * */
 public static double Distance(Point2F p1, Point2F p2)
 {
     return(Math.Sqrt(Math.Pow((p2.X - p1.X), 2) + Math.Pow((p2.Y - p1.Y), 2)));
 }