ApasScript.

Units

These are Apas Cloud services: they run on our servers for a signed-in member. The examples below are shown already made; sign in to edit and run your own.

quantity Apas Cloud

A number with a unit. It is kept exactly (72 km/h is exactly 20 m/s inside) and shown in the unit it was written in. Quantities are added, subtracted, multiplied, divided, raised to a whole or fraction power (V^(2/3) of a volume is an area, x^(1/3) a cube root), compared and square-rooted with the ordinary operators; a product or quotient is shown in SI units (N, J, m/s^2), except that quantities in powers of one unit keep it (ft times ft is ft^2), and a ratio of like quantities is a plain number, so it goes into exp, ln, log10, the trigonometric and inverse trigonometric functions and any power (exp(-y/H), atan(a/g), (r_2/r_1)^(3/2)); a quantity with a dimension does not. A sum or difference of two units is shown in SI units, except when the first is a US or other named unit that is not SI (5 lb + 8 oz is 11/2 lb, 1 h + 30 min is 3/2 h). Adding a length to a time is an error. Read the parts with q.value, q.unit and q.si.

convert Apas Cloud

A quantity shown in another unit of the same dimension, exactly: convert(q, "km"). With three arguments it converts a plain number and returns a number: convert(72, "km/h", "m/s") is 20, and convert(12, "in", "ft") is 1. A temperature read on a scale is converted the same way, between "°C", "°F", "K" and "°R" (or degC, degF, degR): convert(212, "°F", "°C") is 100.

toSI Apas Cloud

A quantity shown in coherent SI units: metres, kilograms, seconds and the units named from them (N, J, W, Pa, C, V, Ω, F, Hz).

valueOf Apas Cloud

The number of a quantity, in the unit it is shown in.

valueIn Apas Cloud

The number of a quantity in a given unit, exactly.

unitOf Apas Cloud

The unit a quantity is shown in, as text.

dimensions Apas Cloud

The dimensional formula of a quantity, [M L T^-2] for a force, in the order M, L, T, A, K, mol, cd; a pure number is [M^0 L^0 T^0]. Each power is readable: dimensions(F).T is -2.

constant Apas Cloud

A physical constant as a quantity, by its symbol: c, h, hbar, e, k_B, N_A, R, F, G, g_n (or g), atm, eV, m_e, m_p, m_n, u, eps0, mu0, k_e. The constants that define the SI (c, h, e, k_B, N_A) and those computed from them (R, F) are exact; the others are the CODATA 2022 values. Show one with decimal() or scientific().

uncertainty Apas Cloud

The standard uncertainty of a measured constant (CODATA 2022) as a quantity, or the text "exact" for a constant that is exact in the SI.