This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; // 画像サイズ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// これ ( 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 + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Play with Hata-map / 畑政義写像で遊ぼう</title> | |
<style media="screen"> | |
#container { | |
max-width: 1000px; | |
margin-left: auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/cmplx" | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebGL でマンデルブロくん</title> | |
<style> | |
body { | |
margin:0; | |
overflow:hidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/cmplx" | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
) |