QuantityPoint¶
QuantityPoint
is our affine space type. The
core use cases include:
-
Temperatures. Specifically, when you want to represent “what temperature is it?” rather than “how much did the temperature change?”
-
Mile markers. That is to say, points along a linear path which are indexed by distances. It wouldn’t make sense to add two mile markers, but you can subtract them and obtain a distance (which is a
Quantity
, not aQuantityPoint
).
TODO: this page is a stub
We will provide a full-fledged reference for quantity points later. For now, here are the basics.
-
QuantityPoint<U, R>
stores a value of numeric typeR
(called the “Rep”), whose units are the unit typeU
.- Example:
QuantityPoint<Meters, double>
represents an along-path point, whose distance is measured inMeters
, in adouble
variable.
- Example:
-
We provide “Rep-named aliases” for better ergonomics.
- Example:
QuantityPointD<Meters>
is an alias forQuantityPoint<Meters, double>
.
- Example:
-
You cannot get values into or out of
QuantityPoint
without explicitly naming the unit, at the callsite. We do not have tutorials for this yet, but it works the same asQuantity
. In the meantime, you can read theQuantityPoint
unit tests to see some practical examples.