Example #1
0
        public List <TRNode> GetThinPartition(double eps)
        {
            List <TRNode> ext = null;

            if (this.current != null && this.current.Count > 0)
            {
                ext = new List <TRNode>();
                ext.Add(this.current[0]);
                TRNode node_actual = this.current[0];
                for (int i = 1; i < this.current.Count; i++)
                {
                    TMSegment puente = new TMSegment(node_actual.Point, this.current[i].Point);
                    double    dx     = hipotenusa(puente, eps);
                    int       k      = 1;
                    while (node_actual.Point.X + k * dx < this.current[i].Point.X)
                    {
                        double  inter_x      = node_actual.Point.X + k * dx;
                        TMPoint p_intermedio = new TMPoint(inter_x, puente.eval(inter_x));
                        ext.Add(new TRNode(p_intermedio));
                        k++;
                    }
                    ext.Add(new TRNode(this.current[i].Point));
                    node_actual = this.current[i];
                }
            }
            return(ext);
        }
Example #2
0
 public TRNode(TMPoint p, TRNode u, TRNode l, TRRange r)
 {
     this.lower = l;
     this.upper = u;
     this.point = p;
     this.state = Node_State.Free;
     this.rango = r;
 }