Esempio n. 1
0
        public bool Parallel(CLine line)
        {
            bool bParallel = false;

            if (this.a / this.b == line.a / line.b)
            {
                bParallel = true;
            }

            return(bParallel);
        }
Esempio n. 2
0
        /**************************************
        *  Calculate intersection point of two lines
        *  if two lines are parallel, return null
        * ************************************/
        public CPoint2D IntersecctionWith(CLine line)
        {
            CPoint2D point = new CPoint2D();
            float    a1    = this.a;
            float    b1    = this.b;
            float    c1    = this.c;

            float a2 = line.a;
            float b2 = line.b;
            float c2 = line.c;

            if (!(this.Parallel(line))) //not parallen
            {
                point.X = (c2 * b1 - c1 * b2) / (a1 * b2 - a2 * b1);
                point.Y = (a1 * c2 - c1 * a2) / (a2 * b2 - a1 * b2);
            }
            return(point);
        }
Esempio n. 3
0
    /**************************************
     Calculate intersection point of two lines
     if two lines are parallel, return null
     * ************************************/
    public CPoint2D IntersecctionWith(CLine line)
    {
      CPoint2D point = new CPoint2D();
      float a1 = this.a;
      float b1 = this.b;
      float c1 = this.c;

      float a2 = line.a;
      float b2 = line.b;
      float c2 = line.c;

      if (!(this.Parallel(line))) //not parallen
      {
        point.X = (c2 * b1 - c1 * b2) / (a1 * b2 - a2 * b1);
        point.Y = (a1 * c2 - c1 * a2) / (a2 * b2 - a1 * b2);
      }
      return point;
    }
Esempio n. 4
0
    public bool Parallel(CLine line)
    {
      bool bParallel = false;
      if (this.a / this.b == line.a / line.b)
        bParallel = true;

      return bParallel;
    }
Esempio n. 5
0
 public CLine(CLine copiedLine)
 {
   this.a = copiedLine.a;
   this.b = copiedLine.b;
   this.c = copiedLine.c;
 }
Esempio n. 6
0
 public CLine(CLine copiedLine)
 {
     this.a = copiedLine.a;
     this.b = copiedLine.b;
     this.c = copiedLine.c;
 }