Skip to content

Instantly share code, notes, and snippets.

View ikr7's full-sized avatar
๐Ÿ…ฐ๏ธ
rch Linux

ikr7

๐Ÿ…ฐ๏ธ
rch Linux
View GitHub Profile
LANG=ja_JP.UTF-8
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH # ใตใคใ†ใฎ
export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH # coreutils
export PATH=$HOME/.nodebrew/current/bin:$PATH # nodebrew
export PATH=/Library/TeX/texbin:$PATH # TeX
HISTFILE=~/.zsh_history
HISTSIZE=1000000
SAVEHIST=1000000
import std.stdio;
import std.complex : complex, Complex, abs, arg;
import std.algorithm.comparison : clamp;
import std.format : format;
import conv = std.conv;
import math = std.math;
import IF = imageformats;
alias Image = IF.IFImage;
import std.stdio : writeln;
import std.complex : complex, Complex, abs, arg;
import std.algorithm.comparison : clamp;
import conv = std.conv;
import math = std.math;
import IF = imageformats;
alias Image = IF.IFImage;
immutable int size = 64; // ็”ปๅƒใ‚ตใ‚คใ‚บ
@ikr7
ikr7 / expr.ts
Created March 25, 2017 13:52
่จˆ็ฎ—ใงใ™
// ใ“ใ‚Œ ( https://www.desmos.com/calculator/ktrb025zjm ) ใจๅŠ็›ด็ทšใจใฎไบค็‚นใ‚’ๆฑ‚ใ‚ใ‚‹
// ๆฅ•ๅ††ใฏ this, ๆฅ•ๅ††ใฎๅ„ใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏ desmos ใซๆบ–ใ˜ใ‚‹, ใŸใ ใ— desmos ใงใฎ t ใฏ theta ใจใ—ใŸ
// ๅŠ็›ด็ทšใฏ r, ๅŽŸ็‚นใฏ o, ๆ–นๅ‘ใƒ™ใ‚ฏใƒˆใƒซใฏ d
const A: number = // t^2ใฎไฟ‚ๆ•ฐ
(Math.cos(this.theta) ** 2 * r.d.x ** 2) / this.b ** 2 +
(Math.cos(this.theta) ** 2 * r.d.y ** 2) / this.d ** 2 +
(2 * Math.cos(this.theta) * r.d.x * r.d.y * Math.sin(this.theta)) / this.b ** 2 +
(2 * Math.cos(this.theta) * r.d.x * r.d.y * Math.sin(this.theta)) / this.d ** 2 +
(r.d.x ** 2 * Math.sin(this.theta) ** 2) / this.d ** 2 +
@ikr7
ikr7 / .block
Last active May 1, 2017 22:46
Fractal Dimension Measurement
license: mit
@ikr7
ikr7 / index.html
Last active November 14, 2016 10:00
Play with Hata-map / ็•‘ๆ”ฟ็พฉๅ†™ๅƒใง้Šใผใ†
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Play with Hata-map / ็•‘ๆ”ฟ็พฉๅ†™ๅƒใง้Šใผใ†</title>
<style media="screen">
#container {
max-width: 1000px;
margin-left: auto;
@ikr7
ikr7 / hata_map.go
Created November 1, 2016 12:44
็•‘ๆ”ฟ็พฉๅ†™ๅƒ
package main
import (
"math/cmplx"
"image"
"image/color"
"image/png"
"os"
)
@ikr7
ikr7 / mand_pi.c
Created October 5, 2016 11:22
ใƒžใƒณใƒ‡ใƒซใƒ–ใƒญ้›†ๅˆ๏ผˆใ‚’ๅฎš็พฉใ™ใ‚‹ๆผธๅŒ–ๅผ๏ผ‰ใ‚’็”จใ„ใŸๅ††ๅ‘จ็Ž‡ใฎ่ฟ‘ไผผ
#include <stdio.h>
#include <math.h>
#define MAX_ITER 100000000
int N (long double c) {
long double z = 0.0;
for (int n = 0; n < MAX_ITER; n++) {
z = z * z + c;
if (z >= 2.0) {
@ikr7
ikr7 / index.html
Created October 2, 2016 11:31
WebGL ใงใƒžใƒณใƒ‡ใƒซใƒ–ใƒญใใ‚“ with Distance Estimation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WebGL ใงใƒžใƒณใƒ‡ใƒซใƒ–ใƒญใใ‚“</title>
<style>
body {
margin:0;
overflow:hidden
@ikr7
ikr7 / mand.go
Created September 30, 2016 13:25
ใŠใ›ใˆใ‚ˆ
package main
import (
"math/cmplx"
"image"
"image/color"
"image/png"
"os"
)