duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
license: mit | |
height: 1024 |
/* returns the in-order neighbours of a point - based on matching primitives */ | |
void inorder_neighbours(int point_number; int points[] /* returned */) { | |
int nc = neighbourcount(geoself(), point_number); | |
resize(points, nc); | |
int prims[] = pointprims(geoself(), point_number); | |
int points_in_prim[] = primpoints(geoself(), prims[0]); | |
// | |
// WE EXPECT THREE POINTS PER PRIMITIVE!!! |
// Doing the operation: | |
// | |
// | a a a a | | y | | |
// x * A * y = [ x x x x ] | a a a a | | y | | |
// | a a a a | | y | | |
// | a a a a | | y | | |
// | |
// with SIMD intrinics (specifically AVX). | |
// | |
// adapted from https://gist.github.com/rygorous/4172889 |
/* C99, public domain licensed */ | |
#include <limits.h> | |
#include <stdbool.h> | |
#include <math.h> | |
/* utilities */ | |
#define SWAP(type, a, b) do { \ | |
type sw_ap; \ |
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
ABSOLUTELY NO WARRANTY. | |
If you are still reading let's carry on with the code. | |
sudo apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |
#!/bin/bash -eux | |
gm convert -font helvetica -fill blue -pointsize 36 -draw "text 15,50 'hello'" source.jpg destination.jpg |
(ns gumball-machine.core | |
(:require [thi.ng.color.core :as col] | |
[thi.ng.math.core :as m] | |
[thi.ng.geom.core :as g] | |
[thi.ng.geom.core.vector :refer [vec3]] | |
[thi.ng.geom.physics.core :as ph] | |
[thi.ng.geom.sphere :refer [sphere]] | |
[quil.core :as q :include-macros true])) | |
(def particles |
(defn grow [pos rot points len] | |
(let [[x y z] (last rot) ;; :( no M33 and no (g/rotate-xyz _ (vec3 x y z)) | |
corners (map #(-> % (g/rotate-x x) (g/rotate-y y) (g/rotate-z z) (g/+ (last pos))) | |
[(vec3 0 0 0) (vec3 -1 0 0) (vec3 0 -1 0) (vec3 0 1 0) | |
(vec3 -1 0 len) (vec3 0 -1 len) (vec3 0 1 len) (vec3 0 0 len)])] | |
[(conj (pop pos) (last corners)) | |
rot | |
(conj points (map gu/tessellate-3 (g/faces (apply cub/cuboid corners))))])) | |
(defn build-lsystem [l-system angle len] |