summaryrefslogtreecommitdiffstats
path: root/dev/MinGfx/src/gfxmath.cc
diff options
context:
space:
mode:
authorKT <tran0563@umn.edu>2021-09-21 10:05:57 -0500
committerKT <tran0563@umn.edu>2021-09-21 10:05:57 -0500
commita75b08b76f91451bb586b154fdca872955d8a57a (patch)
treedd1c30f65162c1e12b8f6481bbd102d69f5c7196 /dev/MinGfx/src/gfxmath.cc
parentUpload a1 (diff)
downloadcsci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar.gz
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar.bz2
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar.lz
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar.xz
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.tar.zst
csci4611-a75b08b76f91451bb586b154fdca872955d8a57a.zip
publish a2
Diffstat (limited to '')
-rw-r--r--dev/MinGfx/src/gfxmath.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/dev/MinGfx/src/gfxmath.cc b/dev/MinGfx/src/gfxmath.cc
index 11180e6..28cfedf 100644
--- a/dev/MinGfx/src/gfxmath.cc
+++ b/dev/MinGfx/src/gfxmath.cc
@@ -19,6 +19,61 @@ const float GfxMath::PI = 3.14159265359f;
const float GfxMath::TWO_PI = 6.28318530718f;
const float GfxMath::HALF_PI = 1.57079632679f;
+float GfxMath::sin(float a) {
+#ifdef WIN32
+ return std::sinf(a);
+#else
+ return std::sin(a);
+#endif
+}
+
+float GfxMath::cos(float a) {
+#ifdef WIN32
+ return std::cosf(a);
+#else
+ return std::cos(a);
+#endif
+}
+
+float GfxMath::tan(float a) {
+#ifdef WIN32
+ return std::tanf(a);
+#else
+ return std::tan(a);
+#endif
+}
+
+float GfxMath::asin(float a) {
+#ifdef WIN32
+ return std::asinf(a);
+#else
+ return std::asin(a);
+#endif
+}
+
+float GfxMath::acos(float a) {
+#ifdef WIN32
+ return std::acosf(a);
+#else
+ return std::acos(a);
+#endif
+}
+
+float GfxMath::atan(float a) {
+#ifdef WIN32
+ return std::atanf(a);
+#else
+ return std::atan(a);
+#endif
+}
+
+float GfxMath::atan2(float a, float b) {
+#ifdef WIN32
+ return std::atan2f(a, b);
+#else
+ return std::atan2(a, b);
+#endif
+}
float GfxMath::Clamp(float x, float a, float b) {
return std::min(std::max(x, a), b);