Skip to content

Commit

Permalink
docs: "Quick Start" chapter updated with implicit origins
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Dec 21, 2023
1 parent fdacde6 commit ea7c97d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/getting_started/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ static_assert(140 * km / (2 * h) == 70 * km / h);
## Quantity points
The quantity point specifies an absolute quantity with respect to an origin.
If no origin is provided explicitly, an implicit one will be provided by the library.
Together with quantities, they model [The Affine Space](../users_guide/framework_basics/the_affine_space.md).
Quantity points should be used in all places where adding two values is meaningless
Expand All @@ -106,10 +108,10 @@ int main()
using namespace mp_units::si::unit_symbols;
using namespace mp_units::usc::unit_symbols;
quantity_point temp = si::zeroth_degree_Celsius + 20. * deg_C;
quantity_point temp{20. * deg_C};
std::cout << "Temperature: "
<< temp.quantity_from(si::zeroth_degree_Celsius) << " ("
<< temp.in(deg_F).quantity_from(usc::zeroth_degree_Fahrenheit) << ")\n";
<< temp.quantity_from_zero() << " ("
<< temp.in(deg_F).quantity_from_zero() << ")\n";
}
```

Expand Down

0 comments on commit ea7c97d

Please sign in to comment.