- Define a circle as the set of points equidistant from a center point.
- The Pythagorean theorem allows us to work out an equation to define the points that fit this curve, by using h as the radius
- Setting the radius to 1 simplifies this, making our equation the unit circle
- To make this parametric (i.e., give an x, get a y), we rearrange thusly:
- Since we know a circle is vertically and horizontlly symmetrical, we can simplify things by dropping the +/-, and by looking only at 0 <= x <= 1; the area under that curve will be 1/4 pi.
![f(0 <= x <= 1) = sqrt(1 - x^2)](http://latex.codecogs.com/png.latex?f\(0&space;\\leq&space;x&space;\\leq&space;1\)&space;=&space;\\
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
/** | |
Usage (the label is required) | |
<input id="uid" type="checkbox" ... /><label for="uid">Label</label> | |
Produces styled checkboxes in IE9+, current Firefox and Chrome | |
Demo here: http://jsfiddle.net/7Fggq/ | |
@author Bryan Elliott <ook@codemonkeybryan.com> | |
*/ |
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
/** | |
* This file will reduce the size of and improve the performance of certain arduino code | |
* 1. It strips away about 310 bytes of overhead by replacing the implicit main function with a minimal one (which will also be faster) | |
* 2. It replaces the library `pinMode` and `digitalWrite` code with register-based variants - saving 120 | |
* bytes - and which which perform faster than the built-ins for single-pin changes (for multi-pin changes, | |
* use the registers yourself). | |
*/ | |
#ifndef ECON_101 | |
#define ECON_101 |
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" /> | |
<script> | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
var context = new AudioContext(); | |
function playSound(arr) { | |
var buf = new Float32Array(arr.length) |
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
(function () { | |
var sayHi = function (token) { | |
if (!token.progress) token.progress = {}; | |
token.progress.saidHi = (token.progress.saidHi||0) + 1; | |
//true == simply proceed; false == reject workflow | |
return true; | |
}, | |
shakeIt = function (token, next) { | |
token.progress.shook = (token.progress.shook||0) + 1; | |
next('right'); |
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
#!/bin/sh | |
# From the Stack response: | |
# http://stackoverflow.com/a/33133769/353872 | |
# | |
# Also acts as a low-complexity example of how to flexibly parse the argument | |
# list in raw sh without external programs or a lot of fuss. | |
# For use in usage() and in log messages | |
SCRIPT_NAME="$(basename $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
#!/bin/sh | |
# From the Stack response: | |
# http://stackoverflow.com/a/33133769/353872 | |
# | |
# Also acts as a low-complexity example of how to flexibly parse the argument | |
# list in raw sh without external programs or a lot of fuss. | |
# For use in usage() and in log messages | |
SCRIPT_NAME="$(basename $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
(() => { | |
const letters = { | |
a: 'ay', | |
b: 'bee', | |
c: 'see', | |
d: 'dee', | |
e: 'eee', | |
f: 'eff', | |
g: 'jee', | |
h: 'aitch', |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 lang="en-US"> | |
<head> | |
<meta charset="ISO-8859-1"> | |
<title>Mega Man X1 Password Generator</title> | |
<script type="module" defer> | |
import { render, html, css, useState } from 'https://unpkg.com/@fordi-org/buildless'; | |
const heart = 'Heart Tank'; | |
const subTank = 'Sub-tank'; | |
const levels = { |