Published
Edited
Dec 2, 2021
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
constant(...getUnit(sel_unit).toSI(1)).html
Insert cell
getUnit(sel_unit)
Insert cell
Insert cell
constant(...getUnit('mile').toSI(1)).html
Insert cell
constant(...getUnit('kilometer').fromSI(...getUnit('mile').toSI(1))).html
Insert cell
constant(...getUnit('mile').fromSI(1, getUnit('cm'))).html
Insert cell
Insert cell
isVersion('>0.1.33')
? Units.money.divide(Units.area).divide(Units.money.divide(Units.volume)).html
: `No money units in ${VERSION}`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
FRAME = WORLD.createInertialFrame()
Insert cell
constant(3, Units.mass).html
Insert cell
Insert cell
viewof G = isVersion('>=0.1.27')
? gFunction(Units.velocity, 'f', t => t).html
: new PM.GFunction(t => t, Units.velocity).setName_('f').html
Insert cell
Insert cell
viewof GPRIME = G.derivative().html
Insert cell
viewof GPRIMEPRIME = GPRIME.derivative().html
Insert cell
viewof G2 = G.integral().html
Insert cell
viewof P1 = poly(Units.power, 0, Math.PI, 1).html
Insert cell
viewof P2 = poly(Units.power, 0.5, Math.PI / 2, 1, 1).html
Insert cell
viewof F = PM.add(P1, P2).html
Insert cell
viewof Fprime = F.derivative().html
Insert cell
viewof F2 = F.integral().html
Insert cell
viewof F3 = F2.integral().html
Insert cell
viewof XF3 = F3.from(1 / 2).html
Insert cell
XF3
Insert cell
INITIAL_STYLE.numberSpecials.get(1.5)
Insert cell
Fprime.tex
Insert cell
poly(Units.length, Math.sqrt(2)).html
Insert cell
viewof PW = {
const PW = new Piecewise(Units.length, TYPE.SCALAR);
PW.initial(0);
if (isVersion("<0.1.26")) {
PW.at(1, 3, 2, (5 * Math.PI) / 2, 3, 0);
} else {
PW.at([1, 3], [2, (5 * Math.PI) / 2], [3, 0]);
}
return PW.html;
}
Insert cell
PW.tex
Insert cell
tex`{{\left.\begin{cases}0 &\text{\ if\ } &-\infty&<t\le&1\\3.000 &\text{\ if\ } &1&<t\le&2&\\5.000 &\text{\ if\ } &2&<t\le&3&\\0 &\text{\ if\ } &3&<t\le&\infty&\end{cases}\right\}} \Leftarrow {\textcolor{ff0000}{\text{m}}}}`
Insert cell
PW.derivative().html
Insert cell
[-0.5, 0.5, 1.5, 2.5, 3.5].map(PW.derivative().f)
Insert cell
PW.integral().html
Insert cell
[
PW.integral()
.from(0)
.f(2),
PW.integral()
.from(0)
.f(3)
]
Insert cell
INITIAL_STYLE.context.unit(Units.velocity)
Insert cell
tex`{{\left.\begin{cases}0 &{ t \le 1}\\3.000 &{1 < t }\end{cases}\right\}} \Rightarrow {\textcolor{ff0000}{\text{m}}}}`
Insert cell
Insert cell
PX = new Piecewise(Units.length, TYPE.SCALAR)
.add(-100, 3)
.add(0, 4)
.add(100, 5)
Insert cell
PX.functions
Insert cell
tex`\int_0^3{x dt}`
Insert cell
graph(width)()([constant(2, getUnit('meter'))])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
PM
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
NumberFormats = Object.keys(NumberFormat).filter(v => v.length > 1)
Insert cell
STYLES = {
const obj = {};
Object.keys(NumberFormat).forEach(
f => f.length > 1 && (obj[f] = INITIAL_STYLE.set({ numberFormat: f }))
);
obj.scientificLoose = INITIAL_STYLE.set({
numberFormat: 'scientific',
numberTrimTrailingZero: true
});
return obj;
}
Insert cell
Insert cell
OSTYLE = setStyle(STYLE)
Insert cell
(OSTYLE, poly(Units.length, 3783.99).html)
Insert cell
INITIAL_STYLE.context.number(3783.99)
Insert cell
INITIAL_STYLE.context.exponentStyle.number(3783.99)
Insert cell
Insert cell
Insert cell
// Apply highlight.js's 'vs' (Visual Studio, I presume) styling to code blocks
applyHljsStyle('vs')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more