<commit_before>const l = console.log;

// require
const gm = require('gm')
const args = require("argv").run().targets;

// lib
const Coordinate = require("./lib/Coordinate");

// const 
const width = 500;
const height = 500;
const pi = Math.PI;

// args
const n = args[0] ? args[0] : 3;
const color = args[1] ? args[1] : "white";

// image
let pic = gm(width, height, color);

// coordinate
let c = new Coordinate(width, height);
let p = c.createPoit(0, 200);
let origin = c.createOrigin();

// line
// pic.stroke("red", 3)
// .drawLine(p._.x, p._.y, origin._.x, origin._.y);

// rotate
// p.rotate(2 * pi / 3);
// pic.stroke("green", 3).drawLine(p._.x, p._.y, origin._.x, origin._.y);

// p.rotate(2 * pi / 3);
// pic.stroke("blue", 3).drawLine(p._.x, p._.y, origin._.x, origin._.y);


// polygon
for (let i = 1; i <= n; i++) {
    let old = p;
    p.rotate(2 * pi / n);
    pic.stroke("red", 1).drawLine(origin._.x, origin._.y, p._.x, p._.y);
}

// save
pic.write('picture/polygon.png', function(err) {
    if (err) throw err;
});
<commit_msg>make polygon<commit_after>const l = console.log;

// require
const gm = require('gm')
const args = require("argv").run().targets;

// lib
const Coordinate = require("./lib/Coordinate");

// const 
const width = 500;
const height = 500;
const pi = Math.PI;

// args
const n = args[0] ? args[0] : 3;
const color = args[1] ? args[1] : "white";

// image
let pic = gm(width, height, color);

// coordinate
let c = new Coordinate(width, height);
let p = c.createPoit(0, 200);

// polygon
for (let i = 1; i <= n; i++) {
    let oldX = p._.x;
    let oldY = p._.y;
    p.rotate(2 * pi / n);
    pic.stroke("red", 1).drawLine(oldX, oldY, p._.x, p._.y);
}

// save
pic.write('picture/polygon.png', function(err) {
    if (err) throw err;
});

{'fraction_non_alphanumeric': 0.2170978627671541, 'fraction_numerical': 0.024184476940382452, 'mean_word_length': 2.9271523178807946, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1393287', 'n_tokens_mistral': 739, 'n_tokens_neox': 700, 'n_words': 185}