*Initialize the variable for coordinate of vertexes of rectangle2
VertexesY:=[]
VertexesX:=[]
*Initialize the temperary variables
RowTem:=0
ColTem:=0
*Judge the rectangle if it is available
if(Len1<0 or Len2<0)
return()
endif
*Compute the sine and cosine of tuple Phi
tuple_cos(Phi,Cos)
tuple_sin(Phi,Sin)
*Compute the coordinate of the upper-right vertex of rectangle
RowTem:=CenterY-Len1*Sin-Len2*Cos
ColTem:=CenterX+Len1*Cos-Len2*Sin
VertexesY:=[VertexesY,RowTem]
VertexesX:=[VertexesX,ColTem]
*Compute the coordinate of the upper-left vertex of rectangle
RowTem:=CenterY+Len1*Sin-Len2*Cos
ColTem:=CenterX-Len1*Cos-Len2*Sin
VertexesY:=[VertexesY,RowTem]
VertexesX:=[VertexesX,ColTem]
*Compute the coordinate of the bottom-left vertex of rectangle
RowTem:=CenterY+Len1*Sin+Len2*Cos
ColTem:=CenterX-Len1*Cos+Len2*Sin
VertexesY:=[VertexesY,RowTem]
VertexesX:=[VertexesX,ColTem]
*Compute the coordinate of the bottom-right vertex of rectangle
RowTem:=CenterY-Len1*Sin+Len2*Cos
ColTem:=CenterX+Len1*Cos+Len2*Sin
VertexesY:=[VertexesY,RowTem]
VertexesX:=[VertexesX,ColTem]
return ()