function Polygon(number){\r
+ // resolution : 0.1\r
+ \r
// method\r
function push(x, y){ // void\r
var temp = new Object();\r
- temp.x = Math.floor(x);\r
- temp.y = Math.floor(y);\r
+ temp.x = Math.floor(x*10)/10;\r
+ temp.y = Math.floor(y*10)/10;\r
this.array.push(temp);\r
}\r
Polygon.prototype.push = push;\r
\r
function set(index, x, y){ // void\r
- this.array[index].x = Math.floor(x);\r
- this.array[index].y = Math.floor(y);\r
+ this.array[index].x = Math.floor(x*10)/10;\r
+ this.array[index].y = Math.floor(y*10)/10;\r
}\r
Polygon.prototype.set = set;\r
\r
\r
function generateSVG(){ // string\r
var buffer = "";\r
- buffer += "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n";\r
- buffer += "<svg width=\"200\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\">\n";\r
+ buffer += "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\">\n";\r
buffer += "<g fill=\"black\">\n";\r
for(var i = 0; i < this.array.length; i++){\r
buffer += "<polygon points=\"";\r