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
hellofff |
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
// at time 0 (when t_in=0) values for x and dy are 0, while value for y is 50 (values hardcoded below). | |
// the floor is at y=190 so the ball will start falling until it reaches 190, and then bounce. | |
// dy calculates the change to y in each time step (except where the "floor rule" bites). | |
// dy is 3 at t_in=1 and is influenced by a dampener input | |
/////////// model /////////// | |
// explicit inputs (by convention): | |
export const t = () => t_in; | |
export const dx = () => dx_in; |
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
**Shell of DN blog for [calculang](https://github.com/calculang/calculang)** | |
Under motivation I list: | |
- separation of concerns | |
- unity | |
- transparency | |
- democratisation of numbers | |
I need to elaborate on these, e.g. in relation to some examples. |
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
p5(sketch => { | |
sketch.setup = function () { | |
sketch.createCanvas(width, 200); | |
}; | |
var x = 0, y = 50, dy = 0; | |
sketch.draw = function () { | |
if (x > 600) { x = 0; y = 50; dy = 0; } | |
sketch.background("#001b42"); | |
x += dx_in; |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"facet": {"row": {"field": "function", "type": "ordinal"}}, | |
"data": { | |
"values":[{"t_in":0,"dx_in":-3,"function":"x","value":97},{"t_in":0,"dx_in":0,"function":"x","value":100},{"t_in":0,"dx_in":3,"function":"x","value":103},{"t_in":1,"dx_in":-3,"function":"x","value":94},{"t_in":1,"dx_in":0,"function":"x","value":100},{"t_in":1,"dx_in":3,"function":"x","value":106},{"t_in":2,"dx_in":-3,"function":"x","value":91},{"t_in":2,"dx_in":0,"function":"x","value":100},{"t_in":2,"dx_in":3,"function":"x","value":109},{"t_in":3,"dx_in":-3,"function":"x","value":88},{"t_in":3,"dx_in":0,"function":"x","value":100},{"t_in":3,"dx_in":3,"function":"x","value":112},{"t_in":4,"dx_in":-3,"function":"x","value":85},{"t_in":4,"dx_in":0,"function":"x","value":100},{"t_in":4,"dx_in":3,"function":"x","value":115},{"t_in":5,"dx_in":-3,"function":"x","value":82},{"t_in":5,"dx_in":0,"function":"x","value":100},{"t_in":5,"dx_in":3,"function":"x","value":118},{"dx_i |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "description TODO", | |
"data": { | |
"values": [ | |
{"t_in": 0, "dx_in": -3, "function": "x", "value": 97}, | |
{"t_in": 0, "dx_in": 0, "function": "x", "value": 100}, | |
{"t_in": 0, "dx_in": 3, "function": "x", "value": 103}, | |
{"t_in": 1, "dx_in": -3, "function": "x", "value": 94}, | |
{"t_in": 1, "dx_in": 0, "function": "x", "value": 100}, |
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
[ | |
{ | |
"budgetYear": 0, | |
"forecastYear": -1, | |
"value": 100 | |
}, | |
{ | |
"budgetYear": 0, | |
"forecastYear": 0, | |
"value": 104.5 |
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
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"description": "A recreation of a New York Times chart showing U.S. budget forecasts versus reality.", | |
"width": 700, | |
"height": 400, | |
"padding": 5, | |
"background": "#edf1f7", | |
"config": { | |
"axisBand": { |
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
[ | |
{ | |
"detail": -1, | |
"type": "Actual", | |
"function": "subs", | |
"year": -1, | |
"value": 100 | |
}, | |
{ | |
"detail": -1, |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"data": {"url": "https://gist.githubusercontent.com/declann/a1ee5de2ab49980f94f58ef9af20ca96/raw/52d4e16584e4abfab765e37495392eb7e3b87b18/gistfile1.txt"}, | |
"mark": {"type": "line", "point": true}, | |
"encoding": { | |
"x": {"field": "year", "type": "ordinal"}, | |
"y": {"field": "value", "type": "quantitative", "scale": {"zero": false}}, | |
"detail": {"field": "detail", "type": "ordinal"} | |
} | |
} |
OlderNewer