doodle  0.2
Intended to support teaching C++, doodle is a simple library that helps make a window and makes it easy to do some drawing.
angle.hpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------*
2  Copyright (C) 2021 Rudy Castan
3 
4  This file is distributed WITHOUT ANY WARRANTY. See the file
5  `License.md' for details.
6 *--------------------------------------------------------------*/
7 #pragma once
8 
9 
10 namespace doodle
11 {
27  constexpr double PI = 3.1415926535897932384626433832795028;
39  constexpr double HALF_PI = PI / 2.0;
50  constexpr double QUARTER_PI = PI / 4.0;
62  constexpr double TWO_PI = 2.0 * PI;
63 
78  constexpr double to_radians(double angle_in_degrees) noexcept { return angle_in_degrees * PI / 180.0; }
93  constexpr double to_degrees(double angle_in_radians) noexcept { return angle_in_radians * 180.0 / PI; }
94 
96 }
constexpr double HALF_PI
Definition: angle.hpp:39
constexpr double to_radians(double angle_in_degrees) noexcept
Converts a degree measurement to its corresponding value in radians. Radians and degrees are two ways...
Definition: angle.hpp:78
constexpr double QUARTER_PI
Definition: angle.hpp:50
constexpr double PI
Definition: angle.hpp:27
constexpr double to_degrees(double angle_in_radians) noexcept
Converts a radian measurement to its corresponding value in degrees. Radians and degrees are two ways...
Definition: angle.hpp:93
constexpr double TWO_PI
Definition: angle.hpp:62
Definition: angle.hpp:11