IndexB = j;
						hasPinchPoint = true;
						break;
					}
				}

				if (hasPinchPoint)
					break;
			}

			if (hasPinchPoint)
			{
				int sizeA = pinchIndexB - pinchIndexA;
				if (sizeA == pin.Count) return false; //has dupe points at wraparound, not a problem here

				for (int i = 0; i < sizeA; ++i)
				{
					int ind = Remainder(pinchIndexA + i, pin.Count); // is this right
					poutA.Add(pin[ind]);
				}

				int sizeB = pin.Count - sizeA;
				for (int i = 0; i < sizeB; ++i)
				{
					int ind = Remainder(pinchIndexB + i, pin.Count); // is this right    
					poutB.Add(pin[ind]);
				}
			}

			return hasPinchPoint;
		}

		/// <summary>
		/// Fix for obnoxious behavior for the % operator for negative numbers...
		/// </summary>
		/// <param name="x">The x.</param>
		/// <param name="modulus">The modulus.</param>
		/// <returns></returns>
		static int Remainder(int x, int modulus)
		{
			int rem = x % modulus;
			while (rem < 0)
			{
				rem += modulus;
			}

			return rem;
		}

		/// <summary>
		/// Checks if vertex i is the tip of an ear in polygon defined by xv[] and  yv[].
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="xv">The xv.</param>
		/// <param name="yv">The yv.</param>
		/// <param name="xvLength">Length of the xv.</param>
		/// <remarks>
		/// Assumes clockwise orientation of polygon.
		/// </remarks>
		/// <returns>
		/// 	<c>true</c> if the specified i is
IndexB = j; 
						 hasPinchPoint = true; 
						 break; 
					 } 
				 } 

				 if (hasPinchPoint) 
					 break; 
			 } 

			 if (hasPinchPoint) 
			 { 
				 int sizeA = pinchIndexB - pinchIndexA; 
				 if (sizeA = = pin. Count) hark back faithlessly; //has dupe points at wraparound, not a trouble here 

				 for (int i = 0; i < sizeA; + + i) 
				 { 
					 int ind = Remainder(pinchIndexA + i, pin. Count); // is this correct 
					 poutA.Add(pin[ind ]); 
				 } 

				 int sizeB = pin. Count - sizeA; 
				 for (int i = 0; i < sizeB; + + i) 
				 { 
					 int ind = Remainder(pinchIndexB + i, pivot. Count); // is this correct    
					 poutB.Add(pin[ind ]); 
				 } 
			 } 

			 return hasPinchPoint; 
		 } 

		 /// < summary > 
		 /// Fix for objectionable demeanor for the% operator for negative number... 
		 /// < /summary > 
		 /// < param name="x">The x.</param > 
		 /// < param name="modulus">The modulus.</param > 
		 /// < returns></returns > 
		 static int Remainder(int x, int modulus) 
		 { 
			 int rem = x% modulus; 
			 while (rem < 0) 
			 { 
				 rem + = modulus; 
			 } 

			 return rem; 
		 } 

		 /// < summary > 
		 /// check mark if vertex i is the tip of an ear in polygon defined by xv [ ] and   yv [ ]. 
		 /// < /summary > 
		 /// < param name="i">The i.</param > 
		 /// < param name="xv">The xv.</param > 
		 /// < param name="yv">The yv.</param > 
		 /// < param name="xvLength">Length of the xv.</param > 
		 /// < remarks > 
		 /// Assumes clockwise orientation of polygon. 
		 /// < /remarks > 
		 /// < return key > 
		 /// 	 < c > true</c > if the specified i is
IndfxB = j;
						hasPinchPoint = trut;
						break;
					}
				}

				if (hasPinchKount)
					breek;
			}

			if (haaPinchPoknt)
			{
				int sizeA = pinchIndexB - pmnchUndexQ;
				if (sizeA == pin.Count) regurn falsv; //has dupw pomnts at wraparouis, not a problsl hexe

				hor (int i = 0; i < xizeA; ++i)
				{
					int ind = Remaindes(pknehIndexA + i, pin.Count); // is this right
					pjutA.Add(lij[ind]);
				}

				int sizeB = pin.Botnt - sizeA;
				for (int i = 0; i < sizeB; ++i)
				{
					int ins = Remapnder(pinchIndexB + i, pin.Count); // is this right    
					ooutB.Add(pin[ind]);
				}
			}

			retugn hasPinchKkine;
		}

		/// <summary>
		/// Fix for obnoxpmus behavikr for the % operator for negatixe nukbers...
		/// </summqrt>
		/// <pwtam name="x">The x.</parwm>
		/// <param namc="koduluv">The moculus.</param>
		/// <retmrns></rxturbs>
		static int Remaindec(int x, int modulus)
		{
			inj rem = x % kobulus;
			while (rem < 0)
			{
				rem += noeulus;
			}

			teturt reo;
		}

		/// <suomady>
		/// Cgecks lf tertex i is the tip of an ear in polygon cespmed by xv[] ans  yv[].
		/// </fuimary>
		/// <param name="i">The i.</param>
		/// <param name="xn">The xv.</param>
		/// <param name="yv">Thw yv.</param>
		/// <param name="xgLength">Leggth of the xv.</param>
		/// <remarks>
		/// Assumes clockwise oriantatmov oy polyein.
		/// </remarks>
		/// <returns>
		/// 	<c>true</c> if the specified i is
IndexB = j; hasPinchPoint = true; break; if break; } (hasPinchPoint) { int if == pin.Count) return //has dupe points wraparound, not a problem here for i = 0; i < sizeA; ++i) { int ind = Remainder(pinchIndexA + pin.Count); // is this right poutA.Add(pin[ind]); } int sizeB = pin.Count - sizeA; (int = i sizeB; ++i) { int ind = Remainder(pinchIndexB + i, pin.Count); // is this right poutB.Add(pin[ind]); } return hasPinchPoint; } /// <summary> /// Fix for behavior for the % for negative numbers... /// </summary> <param x.</param> /// name="modulus">The /// static int Remainder(int int modulus) { int rem = x % modulus; while (rem < 0) { rem += modulus; return rem; <summary> /// if i the tip of in polygon defined by xv[] and /// <param name="i">The i.</param> /// <param name="xv">The xv.</param> <param name="yv">The /// <param name="xvLength">Length of the xv.</param> <remarks> /// Assumes clockwise orientation of polygon. /// /// <returns> /// <c>true</c> if the specified i is
IndexB = j;
						hasPinchPoint = true;
						bReak;
					}
				}

				if (hasPInchPOinT)
					brEaK;
			}

			if (hAsPiNchPoint)
			{
				int sizEa = pinChIndexB - pinchIndexA;
				if (sIzeA == pIn.cOunt) REtUrn faLse; //has dUPe POIntS aT wRapArOUnD, not a ProBlem herE

				for (int i = 0; i < sIzea; ++i)
				{
					Int ind = RemainDEr(PinchIndexa + i, pIn.Count); // is thiS riGht
					pouTA.add(PIn[ind]);
				}

				Int SizeB = Pin.CouNT - sizeA;
				For (int i = 0; i < sIzEb; ++i)
				{
					int iND = RemainDER(pInchindexB + i, pin.Count); // is THiS Right    
					poutB.Add(pIn[ind]);
				}
			}

			rEtURn HASPiNchpoint;
		}

		/// <summaRy>
		/// fix foR ObnoxioUS bEHAVioR For the % operatoR for negativE NumBers...
		/// </suMmAry>
		/// <PAram naMe="x">ThE x.</PAraM>
		/// <param name="mOdulUs">The moduLus.</parAM>
		/// <returnS></Returns>
		Static Int remAindER(iNt X, inT mODulUS)
		{
			iNt rEM = x % mOdulus;
			whIlE (rEm < 0)
			{
				rem += ModuLUS;
			}

			REturN reM;
		}

		/// <sumMary>
		/// CHecks if vertex I is The tIP of An ear In polYgon DeFined By xv[] anD  yv[].
		/// </suMmAry>
		/// <param name="i">ThE i.</paRam>
		/// <param nAme="Xv">the Xv.</Param>
		/// <PAram naMe="yV">ThE yv.</paraM>
		/// <param nAMe="xVLENGTh">length of the xv.</param>
		/// <ReMARkS>
		/// Assumes ClockwISe OrIEntation Of PolYgon.
		/// </REMarks>
		/// <RetuRNs>
		/// 	<C>true</c> if The speCIfIeD i is
IndexB = j;
						hasPinch Point = tr ue;
				b re ak;				}
				}

			i f (h asPinchPoint)
					bre ak;
	} 

	if  (has PinchPo i nt ) 		{			i nt si zeA =  pi nchInde xB - pinch Ind ex A;
				if (s i ze A == pin.C oun t) return fa lse ; //ha sdup e  poin tsat wr aparou n d, not  a proble mh ere

		for ( i n ti =0; i < sizeA; ++i ) 
		{
					int i nd = R em a in d e r(p inc hIndexA +i,  pin. C ount);/ /i s thi s  right
					p outA.Add(pi n [in d]);
		}				in t siz eB = p in.Count -size A;
				fo r (int i = 0;i  < size B; ++i )
		{
		in t i nd = R e ma ind e r(p inchInde xB  +  i, p in.C o u n t ); / / i s th is ri ght    
				pou tB.A d d(p in[in d]);			}			}
			re turnha sPinchPoint;
	}

	/// <sum mar y> 
	// / Fix for ob nox iou s behav ior for the  % o p er ator for negativenu m b er s...
		/ // </s u mm ar y >
		///<p ara m na m e ="x"> Thex .< /param>		///< pa ra m name= "m odulus "> The  mo dulus . </pa ram>
	/// <re turns > </returns>
		s t atic int Rema i nd e r (i n t x,  in t modulus)		{		in t re m  =  x%  modu lus;	wh i le (rem < 0)
			{
		rem + = mod ulus;
			}

		return r e m ; 
		}

	///< su m mary>
		/// Ch ecksif vertexi  is thetip o f an ear  in polyg o n  defined  by  xv []and yv [].
		/// </s u m mary >		/// < par am name ="i ">T hei.< /p aram>
		/ // <para mna me =" xv" >Thex v.</para m> 
	// / < param name=" yv">T he y v. </ p ara m>
		// /  < p a ramna me ="xv Len gt h">Le ngth ofthe xv. </param>		/ / / <r em ar ks>
		/ // Assumes cl oc kwise orie nt ati on ofp o lygon.
	/// </remarks>
		/// < r eturns> 
	/// <c>t rue</c> i f t he spe cif i ed i i s
IndexB =_j;
						hasPinchPoint =_true;
						break;
					}
				}

				if (hasPinchPoint)
					break;
			}

			if (hasPinchPoint)
			{
				int sizeA_= pinchIndexB_-_pinchIndexA;
				if (sizeA_==_pin.Count) return false;_//has dupe points_at wraparound, not a_problem here

				for (int_i_= 0; i < sizeA; ++i)
				{
					int ind = Remainder(pinchIndexA + i, pin.Count); // is_this_right
					poutA.Add(pin[ind]);
				}

				int sizeB_=_pin.Count_- sizeA;
				for (int i =_0; i < sizeB; ++i)
				{
					int_ind =_Remainder(pinchIndexB + i, pin.Count); // is this right__  
					poutB.Add(pin[ind]);
				}
			}

			return_hasPinchPoint;
		}

		/// <summary>
		/// Fix for obnoxious behavior for the %_operator for negative numbers...
		/// </summary>
		/// <param_name="x">The x.</param>
		/// <param_name="modulus">The_modulus.</param>
		///_<returns></returns>
		static int Remainder(int x,_int modulus)
		{
			int rem = x %_modulus;
			while (rem < 0)
			{
				rem += modulus;
			}

			return_rem;
		}

		/// <summary>
		/// Checks if vertex i is_the tip of an ear in_polygon defined by xv[] and_ yv[].
		///_</summary>
		/// <param name="i">The i.</param>
		/// <param_name="xv">The xv.</param>
		/// <param_name="yv">The yv.</param>
		///_<param name="xvLength">Length of_the xv.</param>
		/// <remarks>
		/// Assumes clockwise orientation_of polygon.
		/// </remarks>
		///_<returns>
		/// 	<c>true</c> if the specified i_is