// import settings;
import graph;
// pdfviewer="evince";
// psviewer="evince";
// returns a pair representation of a relative number of the equivalent class
pair pairRepresentation(int n){
if(n>0){
return(n,0);
}else{
return(0,-n);
}
}
string nullString(real r){
return "";
}
void drawCoordinates(pair point, align align=NoAlign){
label("$("+string(point.x)+","+string(point.y)+")$",point,align);
}
unitsize(50,50);
int num = 10;
int i;
for (i=-1*num ; i<=num ; ++i) {
pair point = pairRepresentation(i) ;
dot(point,red);
// equivalence classes labelled with usual names, in blue
label("$\mathbf{"+string(i)+"}$",point,5SW,fontsize(17)+blue);
int j;
for(j=abs(i);j<num;++j) {
drawCoordinates(point,E);
pair nextpoint = point + (1,1);
draw(point -- nextpoint,blue+Dotted+linewidth(2));
dot(point,red+linewidth(5));
point=nextpoint;
}
dot(point,red);
draw(point -- point+(0.5,0.5),blue+Dotted+linewidth(2));
dot(point,red+linewidth(5));
drawCoordinates(point,E);
}
// axes
real decay=-0.2;
ticks tick=RightTicks(N=0,n=1,end=false,nullString);
xaxis("$n_1$",YEquals(decay),decay,num+1.0,tick,Arrow);
yaxis("$n_2$",XEquals(decay),decay,num+1.0,LeftTicks(N=0,n=1,end=false,nullString),Arrow);