Skip to content

Commit

Permalink
docs: subtraction of two points to get an absolute quantity case …
Browse files Browse the repository at this point in the history
…added
  • Loading branch information
mpusz committed Aug 3, 2023
1 parent bc2a357 commit 290161a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/users_guide/framework_basics/the_affine_space.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,19 @@ As we can see above, the `relative()` member function returns a relative distanc
point origin. In case we would like to know the absolute altitude that we reached on this climb,
we can either:

- add the two relative heights from both points
- add the two relative heights from both _points_

```cpp
static_assert(first_climb_alt.relative() + everest_base_camp_alt.relative() == 5406 * m);
```

- call `absolute()` member function
- subtract the "zero altitude" _point_ from the current _point_

```cpp
static_assert(first_climb_alt - quantity_point{0 * m, mean_sea_level} == 5406 * m);
```

- call `absolute()` member function on the current _point_

```cpp
static_assert(first_climb_alt.absolute() == 5406 * m);
Expand Down

0 comments on commit 290161a

Please sign in to comment.