%% TITLE: nl-interval v1.0
%%
%% Copyright 2021 Antero Neves
%%
%% This work may be distributed and/or modified
%% under the conditions of the LaTeX Project Public License,
%% either version 1.3c of this license or any later version.
%% The latest version of this license is in 
%% http://www.latex-project.org/lppl.txt.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nl-interval} % Version 1.0

\RequirePackage{xparse,tkz-fct,ifthen}

\definecolor{MyBlueAN}{RGB}{59,89,152}
%\definecolor{MyGreenAN}{HTML}{7e8464}
%\definecolor{MyRedAN}{HTML}{90030c}


%--------- Defines Axes ---------%
\NewDocumentCommand{\nlAxisX}{m m}{
	\def\xmin{#1}
	\def\xmax{#2}
	\tkzInit[xmin=#1,xmax=#2]
	\tkzDrawX[noticks]}


%--------- Defines command to draw interval from number to +infinity ---------%
\NewDocumentCommand{\nlnuminf}{o m o m o}{
	\IfNoValueTF{#1}
	{	
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5] (#2,0) rectangle (\xmax,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmax,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5] (#2,0) rectangle (\xmax,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmax,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}
		}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5] (#2,0) rectangle (\xmax,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmax,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5] (#2,0) rectangle (\xmax,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmax,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}	
		}
	}
	{
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5,#1] (#2,0) rectangle (\xmax,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmax,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5,#1] (#2,0) rectangle (\xmax,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmax,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}
		}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5,#1] (#2,0) rectangle (\xmax,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmax,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=east,opacity=.5,#1] (#2,0) rectangle (\xmax,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmax,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}	
		}
	}
}

%--------- Defines command to draw interval from -infinity to a number ---------%
\NewDocumentCommand{\nlinfnum}{o m o m o}{
	\IfNoValueTF{#1}
	{	
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5] (#2,0) rectangle (\xmin,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmin,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5] (#2,0) rectangle (\xmin,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmin,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}
		}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5] (#2,0) rectangle (\xmin,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmin,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5] (#2,0) rectangle (\xmin,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmin,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}	
		}
	}
	{
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5,#1] (#2,0) rectangle (\xmin,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmin,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#2\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5,#1] (#2,0) rectangle (\xmin,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmin,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}
		}
		{
			\IfNoValueTF{#5}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5,#1] (#2,0) rectangle (\xmin,.5);
				\draw[->,>=stealth] (#2,0)--(#2,.5)--(\xmin,.5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,.5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,.5) circle[radius=1.5pt];
					}
					{}
				}
			}
			{
				\tkzDefPoint(#2,0){A}
				\tkzDrawPoint[shape=cross](A)
				\tkzLabelPoint[below](A){\(#3\)}
				\fill[MyBlueAN!30, path fading=west,opacity=.5,#1] (#2,0) rectangle (\xmin,#5);
				\draw[->,>=stealth] (#2,0)--(#2,#5)--(\xmin,#5);
				\ifthenelse
				{\equal{#4}{o}}
				{	
					\draw[fill=white] (#2,#5) circle [radius=1.5pt];
				}
				{
					\ifthenelse
					{\equal{#4}{c}}
					{
						\draw[fill=black] (#2,#5) circle[radius=1.5pt];
					}
					{}
				}
			}	
		}
	}
}

%--------- Defines command to draw interval from a number to a number ---------%
\NewDocumentCommand{\nlnumnum}{o m o m m o m o}{
	\IfNoValueTF{#1}
	{	
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#6}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
		}
		{
			\IfNoValueTF{#6}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
		}
	}
	{
		\IfNoValueTF{#3}
		{
			\IfNoValueTF{#6}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#2\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
		}
		{
			\IfNoValueTF{#6}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#5\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
			{
				\IfNoValueTF{#8}
				{	
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,.5);
					\draw (#2,0)--(#2,.5)--(#5,.5)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,.5) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,.5) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,.5) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,.5) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,.5) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,.5) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}
				}
				{
					\tkzDefPoint(#2,0){A}
					\tkzDrawPoint[shape=cross](A)
					\tkzLabelPoint[below](A){\(#3\)}
					\tkzDefPoint(#5,0){B}
					\tkzDrawPoint[shape=cross](B)
					\tkzLabelPoint[below](B){\(#6\)}
					\fill[MyBlueAN!30,opacity=.5,#1] (#2,0) rectangle (#5,#8);
					\draw (#2,0)--(#2,#8)--(#5,#8)-- (#5,0);
					\ifthenelse
					{\equal{#4}{o}}
					{	
						\draw[fill=white] (#2,#8) circle [radius=1.5pt];
						
						\ifthenelse
						{\equal{#7}{o}}
						{
							\draw[fill=white] (#5,#8) circle [radius=1.5pt];
						}
						{
							\ifthenelse
							{\equal{#7}{c}}
							{
								\draw[fill=black] (#5,#8) circle[radius=1.5pt];
							}
							{}	
						}
					}
					{
						\ifthenelse
						{\equal{#4}{c}}
						{
							\draw[fill=black] (#2,#8) circle[radius=1.5pt];
							\ifthenelse
							{\equal{#7}{o}}
							{
								\draw[fill=white] (#5,#8) circle [radius=1.5pt];
							}
							{
								\ifthenelse
								{\equal{#7}{c}}
								{
									\draw[fill=black] (#5,#8) circle[radius=1.5pt];
								}
								{}	
							}
						}
						{}
					}	
				}
			}
		}
	}
}


