Skip to content

Instantly share code, notes, and snippets.

View mitchr's full-sized avatar
🍰

Mitchell Riley mitchr

🍰
View GitHub Profile
@mitchr
mitchr / cShoot.m
Last active January 13, 2020 03:31
function [t, z] = cShoot(r, R, a, b, thetaBC, phiBC, h, tol)
% cShoot Solve BVP for toroidal geodesic
% r is aximuthal radius on xz plane
% R is radius from xy plane
% a is the initial time
% b is the final time
% Boundary conditions for theta and phi are given as 2 element vectors:
% thetaBC = [alpha0, beta0], where
% theta(a) = alpha0
% theta(b) = beta0
@mitchr
mitchr / memory.go
Last active May 2, 2017 20:25
Access memory at an arbitrary address
package memory
import "unsafe"
// Poke writes a int size value to an address
func Poke(addr uintptr, val int) {
o := (*int)(unsafe.Pointer(addr))
*o = val
}