sclass LineWithColor implements RenderableWithHints { Pt a, b; RGB color; int width = 14; *() {} *(Pt *a, Pt *b, RGB *color) {} *(Pt *a, Pt *b, Color color, int *width) { this.color = new RGB(color); } public void renderOn(Graphics2D g, int w, int h) { drawRoundEdgeLine(g, a, b, toColor(color), width); } public void renderHints(Graphics2D g, int w, int h) { fillRect(g, a.x, a.y, 1, 1, hintColor()); fillRect(g, b.x, b.y, 1, 1, hintColor()); } // 0 to 360 (clockwise, 0 is north) double angle() { double angle = Math.toDegrees(Math.atan2(b.y-a.y, b.x-a.x)); ret mod(angle+90, 360); } }