Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2003-2019 Andy Little.
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see http://www.gnu.org/licenses./
|
|
|
|
*/
|
|
|
|
|
Split the various non-si length units into their own namespaces.
new namespaces are
international ( combination of us and imperial + Canada etc)
iau (https://www.iau.org/
imperial ( old imperial units)
typographical ( for sizes of printing fonts etc)
These namespace are based on some research , mainly on wikipedia.
Look in src/include/units/physical/si/length.h to see links to see the references to documentation justifying the change.
Unfortunately there are 3 foot units for example, an old imperial version, an old us version and an international version, which is more recent and attempts to unify the two previous ones. All versions have slight changes in value, so I opted to use the international version
The main change in the layout is that inch,foot and yard have been moved from us to international.
With this modification, I also modified the physical/us/area.hpp, volume.hpp and volume.hpp headers to refer to the international units.
This may not be correct, but if the modified us::foot (rather than international foot is used as a basis for these units, then
there is a ratio integer overflow during compilation, probably due to taking 3rd power of a ratio. After this commit. I will try to show that on another branch.
2020-01-10 02:03:27 +00:00
|
|
|
#include <units/physical/iau/length.h>
|
|
|
|
#include <units/physical/imperial/length.h>
|
2020-01-14 12:50:30 +01:00
|
|
|
#include <units/physical/international/length.h>
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
#include <units/physical/si/area.h>
|
2020-01-14 12:50:30 +01:00
|
|
|
#include <units/physical/si/length.h>
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
#include <units/physical/si/time.h>
|
2020-01-14 12:50:30 +01:00
|
|
|
#include <units/physical/si/volume.h>
|
|
|
|
#include <units/physical/typographic/length.h>
|
|
|
|
#include <units/physical/us/length.h>
|
|
|
|
#include <iostream>
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
using namespace units;
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
|
|
|
void simple_quantities()
|
|
|
|
{
|
2020-03-01 14:44:45 +01:00
|
|
|
using namespace units::si;
|
|
|
|
using namespace units::international;
|
|
|
|
|
|
|
|
using distance = length<metre>;
|
|
|
|
using duration = si::time<second>;
|
2020-01-14 12:50:30 +01:00
|
|
|
|
2020-02-17 15:56:06 +01:00
|
|
|
constexpr distance km = 1.0q_km;
|
|
|
|
constexpr distance miles = 1.0q_mi;
|
2020-01-14 12:50:30 +01:00
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
constexpr duration sec = 1q_s;
|
|
|
|
constexpr duration min = 1q_min;
|
|
|
|
constexpr duration hr = 1q_h;
|
2020-01-14 12:50:30 +01:00
|
|
|
|
|
|
|
std::cout << "A physical quantities library can choose the simple\n";
|
|
|
|
std::cout << "option to provide output using a single type for each base unit:\n\n";
|
|
|
|
std::cout << km << '\n';
|
|
|
|
std::cout << miles << '\n';
|
|
|
|
std::cout << sec << '\n';
|
|
|
|
std::cout << min << '\n';
|
|
|
|
std::cout << hr << "\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void quantities_with_typed_units()
|
|
|
|
{
|
2020-03-01 14:44:45 +01:00
|
|
|
using namespace units::si;
|
|
|
|
using namespace units::international;
|
|
|
|
|
|
|
|
constexpr length<kilometre> km = 1.0q_km;
|
|
|
|
constexpr length<mile> miles = 1.0q_mi;
|
2020-01-14 12:50:30 +01:00
|
|
|
|
|
|
|
std::cout.precision(6);
|
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
constexpr si::time<second> sec = 1q_s;
|
|
|
|
constexpr si::time<minute> min = 1q_min;
|
|
|
|
constexpr si::time<hour> hr = 1q_h;
|
2020-01-14 12:50:30 +01:00
|
|
|
|
|
|
|
std::cout << "A more flexible option is to provide separate types for each unit,\n\n";
|
|
|
|
std::cout << km << '\n';
|
|
|
|
std::cout << miles << '\n';
|
|
|
|
std::cout << sec << '\n';
|
|
|
|
std::cout << min << '\n';
|
|
|
|
std::cout << hr << "\n\n";
|
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
constexpr length<metre> meter = 1q_m;
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << "then a wide range of pre-defined units can be defined and converted,\n"
|
|
|
|
" for consistency and repeatability across applications:\n\n";
|
|
|
|
|
|
|
|
std::cout << meter << '\n';
|
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
std::cout << " = " << quantity_cast<si::astronomical_unit>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<iau::angstrom>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<imperial::chain>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::fathom>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<us::fathom>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::foot>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<us::foot>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::inch>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<iau::light_year>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::mile>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::nautical_mile>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<iau::parsec>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<typographic::pica_comp>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<typographic::pica_prn>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<typographic::point_comp>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<typographic::point_prn>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<imperial::rod>(meter) << '\n';
|
|
|
|
std::cout << " = " << quantity_cast<international::yard>(meter) << '\n';
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void calcs_comparison()
|
|
|
|
{
|
2020-03-01 14:44:45 +01:00
|
|
|
using namespace units::si;
|
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout.precision(20);
|
|
|
|
std::cout << "\nA distinct unit for each type is efficient and accurate\n"
|
|
|
|
"when adding two values of the same very big\n"
|
|
|
|
"or very small type:\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
Length AUTO L1A = 2.q_fm;
|
|
|
|
Length AUTO L2A = 3.q_fm;
|
|
|
|
Length AUTO LrA = L1A + L2A;
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << L1A << " + " << L2A << " = " << LrA << "\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << "The single unit method must convert large\n"
|
|
|
|
"or small values in other units to the base unit.\n"
|
|
|
|
"This is both inefficient and inaccurate\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
length<metre> L1B = L1A;
|
|
|
|
length<metre> L2B = L2A;
|
|
|
|
length<metre> LrB = L1B + L2B;
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << L1B << " + " << L2B << " = " << LrB << "\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << "In multiplication and division:\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
Area AUTO ArA = L1A * L2A;
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << L1A << " * " << L2A << " = " << ArA << "\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << "similar problems arise\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
Area AUTO ArB = L1B * L2B;
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << L1B << " * " << L2B << "\n = " << ArB << '\n';
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
}
|
|
|
|
|
2020-03-01 14:44:45 +01:00
|
|
|
} // namespace
|
|
|
|
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
int main()
|
|
|
|
{
|
2020-01-14 12:50:30 +01:00
|
|
|
std::cout << "This demo was originally posted on com.lang.c++.moderated in 2006\n";
|
|
|
|
std::cout << "http://compgroups.net/comp.lang.c++.moderated/dimensional-analysis-units/51712\n";
|
2020-03-01 14:44:45 +01:00
|
|
|
std::cout << "Here converted to use mp-units library.\n\n";
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
|
2020-01-14 12:50:30 +01:00
|
|
|
simple_quantities();
|
|
|
|
quantities_with_typed_units();
|
|
|
|
calcs_comparison();
|
Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake
Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-06 21:29:05 +00:00
|
|
|
}
|