scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
longitude.hpp
Go to the documentation of this file.
1#ifndef SCIFIR_UNITS_COORDINATES_LONGITUDE_HPP_INCLUDED
2#define SCIFIR_UNITS_COORDINATES_LONGITUDE_HPP_INCLUDED
3
4#include "../units/constants.hpp"
5#include "../util/is_number.hpp"
6#include "../units/scalar_unit.hpp"
7#include "./../meca_number/angle.hpp"
8
9#include <cmath>
10#include <string>
11
12using namespace std;
13
14namespace scifir
15{
16 class longitude : public angle
17 {
18 public:
20
21 longitude();
22 longitude(const longitude& x);
24 explicit longitude(float new_value);
25 explicit longitude(double new_value);
26 explicit longitude(long double new_value);
27 explicit longitude(int new_value);
28 explicit longitude(const string& init_longitude);
29 explicit longitude(const scalar_unit& x);
30 explicit longitude(const angle& x);
31
35 longitude& operator =(const string& init_longitude);
37
39
40 void invert();
41
42 private:
43 void normalize_value();
44 void initialize_from_angle(const angle& x);
46 };
47
48 bool is_longitude(const string& init_longitude);
49}
50
51#endif // SCIFIR_UNITS_COORDINATES_LONGITUDE_HPP_INCLUDED
Class that allows to work with angles. Each angle sizes 4 bytes. Initialization string example: "20°"...
Definition angle.hpp:77
void initialize_from_string(string init_longitude)
longitude::position get_position() const
longitude & operator=(const longitude &x)
Definition longitude.cpp:75
void initialize_from_angle(const angle &x)
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition address.cpp:6
bool is_longitude(const string &init_longitude)