2020-05-20 22:12:03 +02:00
|
|
|
// The MIT License (MIT)
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2018 Mateusz Pusz
|
|
|
|
|
//
|
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
|
//
|
|
|
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
|
|
|
// copies or substantial portions of the Software.
|
|
|
|
|
//
|
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
// SOFTWARE.
|
2020-05-14 17:41:04 +01:00
|
|
|
|
2021-03-30 14:47:05 +02:00
|
|
|
#include <units/bits/external/hacks.h> // IWYU pragma: keep
|
2021-03-30 20:00:23 +02:00
|
|
|
|
|
|
|
|
UNITS_DIAGNOSTIC_PUSH
|
|
|
|
|
UNITS_DIAGNOSTIC_IGNORE_SHADOW
|
2021-04-07 11:26:45 +02:00
|
|
|
#include <units/isq/si/force.h>
|
|
|
|
|
UNITS_DIAGNOSTIC_POP
|
|
|
|
|
|
2020-09-11 21:16:26 +02:00
|
|
|
#include <units/generic/angle.h>
|
2021-03-16 12:03:25 +01:00
|
|
|
#include <units/isq/si/energy.h>
|
2021-03-30 13:21:05 +02:00
|
|
|
#include <units/isq/si/length.h>
|
|
|
|
|
#include <units/isq/si/torque.h> // IWYU pragma: keep
|
2020-12-28 15:18:02 +01:00
|
|
|
#include <units/quantity_io.h>
|
2021-03-30 20:00:23 +02:00
|
|
|
#include <iostream>
|
2021-03-30 14:47:05 +02:00
|
|
|
|
2020-05-14 17:41:04 +01:00
|
|
|
int main()
|
|
|
|
|
{
|
2021-03-30 13:21:05 +02:00
|
|
|
using namespace units::isq;
|
|
|
|
|
using namespace units::isq::si::references;
|
2021-04-07 11:26:45 +02:00
|
|
|
using namespace units::references;
|
2021-03-30 13:21:05 +02:00
|
|
|
|
|
|
|
|
Torque auto torque = 20.0 * (N * m / rad);
|
|
|
|
|
Energy auto energy = 20.0 * J;
|
2020-05-14 17:41:04 +01:00
|
|
|
|
2021-03-30 13:21:05 +02:00
|
|
|
units::Angle auto angle = energy / torque;
|
2020-05-14 17:41:04 +01:00
|
|
|
|
2020-05-20 22:12:03 +02:00
|
|
|
std::cout << angle << '\n';
|
2020-05-14 17:41:04 +01:00
|
|
|
}
|