
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
dimensional
Advanced tools
Dimensional is the ultimate tool for any chemist's, physicist's, or engineer's toolbox. It augments JavaScript or TypeScript by allowing the programmer to assign units to their numerical quantities.
Dimensional
contains 3 main features:
All of these features are extensible and output into a LaTeX-friendly format.
Physical quantities contain a numerical value, which is "scaled" by a unit. The unit in turn measures a dimension or compound of dimensions. The structure of data is outlined below. A quantity contains both a numerical value, and a unit. The unit then contains its respective base dimensions.
For example, the speedometer on your vehicle is a readout of a physical quantity. In this case, the dimension of this quantity is speed, which expressed in base dimensions, is distance over time. If you live in the United States, the unit measured is typically miles per hour and elsewhere in the world, the unit is likely kilometers per hour. Let's say you live in the United States, and your speedometer readout is 65 miles per hour.
Base dimensions refer to the fundamental, independent quality being measured. The physical base dimensions are as follows:
The base dimensions are the building blocks that can be combined to form other measurable qualities, like speed (velocity), from the example above. In physics, compounds of dimensions are referred to as attributes or properties. Here are a few attributes that come pre-packaged in Dimensional
by default:
A unit is a standard measurement of a base or derived dimension. The examples below are some examples of length units that come pre-packaged in Dimensional
by default:
Each one of these units represents a particular "scaling" factor for a numerical quantity.
Units can also be combined in the same way as dimensions to form other measurements. For example, a common measurement of speed (velocity) in the United States is \(\frac{\text{mi}}{\text{hr}}\) or miles over hours.
Units can also be converted into other units of like dimensions.
Units can be further adjusted using prefixes to increase or decrease their magnitude. Units can only have one prefix at a time. Here are a few examples that come pre-packaged in Dimensional
by default:
And here are some default units that use some of these prefixes to scale the base unit:
Unit prefixes provide a convenient way to express very large or very small quantities where a unit of that scale/magnitude might not exist. For example, \(1 \left[ {\text{k}\text{m}} \right] = 1000 \left[ \text{m} \right]\)
All base units can have a prefix to change the magnitude, even if they are not in the SI system. For example, in the volume dimension, 1,000 gallons can be expressed as one \({\text{k}\text{gal}}\).
Lastly, a quantity is a property that can be measured and are described by both a numerical value and a unit.
$$24 \left[ \text{V} \right]$$
Quantities of any unit can be converted to another quantity of any other unit in that same dimension.
$$5.75 \left[ \text{ft} \right] = 175.2... \left[ {\text{c}\text{m}} \right]$$ $${\textbf{L}} = {\textbf{L}}$$
Quantities with the same dimensions can be added to or subtracted from and the dimensions will remain the same. Units will automatically be converted to the first argument's units.
$$5 \left[ \text{ft} \right] + 9 \left[ \text{in} \right] = 5.75 \left[ \text{ft} \right]$$ $${\textbf{L}} + {\textbf{L}} = {\textbf{L}}$$
Any two quantities can be multiplied or divided, and the corresponding units and dimensions will be multiplied or divided.
$$1 \left[ \text{mi} \right] \div 8 \left[ \text{min} \right] = 0.125 \left[ \frac{\text{mi}}{\text{min}} \right]$$ $${\textbf{L}} \div {\textbf{T}} = \frac{{\textbf{L}}}{{\textbf{T}}}$$
Quantities can also be scaled by a constant factor, which does not affect units or dimensions.
$$4 \left[ \text{oz} \right] \times 3 = 12 \left[ \text{oz} \right]$$ $${\textbf{M}} \times 1 = {\textbf{M}}$$
Quantities can be raised to a power, which effectively raises the units and dimensions by that power as well.
$$\left(2 \left[ {\text{c}\text{m}} \right]\right)^{2} = 4 \left[ {\text{c}\text{m}}^{2} \right]$$ $$({\textbf{L}})^{2} = {\textbf{L}}^{2}$$
Dimensional
comes pre-packaged with several standard dimensions, units, and prefixes, but it is completely customizable! This package allows you to define totally custom dimensions, units, and conversions, using all the same basic rules for physical dimensions!
Ready to begin? Start with a simple example of calculating height to learn how to use this package and extend it!
FAQs
Dimensional analysis and unit conversions
The npm package dimensional receives a total of 178 weekly downloads. As such, dimensional popularity was classified as not popular.
We found that dimensional demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.