mirror of
https://github.com/slendidev/smath.git
synced 2025-12-11 12:59:53 +02:00
Add angle conversion functions
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
15
tests/angles.cpp
Normal file
15
tests/angles.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <smath.hpp>
|
||||
|
||||
TEST(AngleReturnRadians, DegInput) {
|
||||
EXPECT_NEAR(smath::deg(180.0), std::numbers::pi, 1e-12);
|
||||
}
|
||||
|
||||
TEST(AngleReturnRadians, RadInput) {
|
||||
EXPECT_DOUBLE_EQ(smath::rad(std::numbers::pi), std::numbers::pi);
|
||||
}
|
||||
|
||||
TEST(AngleReturnRadians, TurnsInput) {
|
||||
EXPECT_NEAR(smath::turns(0.5), std::numbers::pi, 1e-12);
|
||||
}
|
||||
Reference in New Issue
Block a user