Skip to content

Instantly share code, notes, and snippets.

View plegner's full-sized avatar

Philipp Legner plegner

View GitHub Profile
@plegner
plegner / cla.md
Last active June 20, 2020 19:10
Mathigon Contributor License Agreement

Mathigon Individual Contributor License Agreement

Thank you for your contribution to Mathigon's software and content. This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any content, source code, bug fixes, documentation, data, illustrations, media, or other works of authorship (collectively “Contributions”) that you submit or have submitted, in any form and in any manner, to Mathigon Ltd. (“Mathigon”). If you have any questions regarding this Agreement, please email contact@mathigon.org.

You accept and agree to the following terms and conditions for your past, present and future contributions submitted to Mathigon. Except for the licenses granted in this Agreement to Mathigon, its users, and its licensees, you reserve all right, title, and interest in and to your contributions.

Copyright License. You hereby grant, and agree to grant, to Mathigon a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyright license to repro

@plegner
plegner / galaxy.py
Created December 20, 2016 22:30
How far away is the closest alien civilisation in our galaxy?
import math
import random
# Pick a random location that is uniformly distributed in a disk of radius r.
def random_point(r):
  r = random.uniform(0, 1)
  t = random.uniform(0, 2 * math.pi)
  x = math.sqrt(r) * math.cos(t) * r
  y = math.sqrt(r) * math.sin(t) * r