Skip to content

Commit ff10c35

Browse files
committed
Add trig and math functions to Processing_api.h for hoisted classes
1 parent 4feecdc commit ff10c35

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/Processing_api.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@
66
#include <string>
77

88
// ── Math (static, no instance needed) ────────────────────────────────────────
9+
inline float sin(float x) { return ::std::sin(x); }
10+
inline float cos(float x) { return ::std::cos(x); }
11+
inline float tan(float x) { return ::std::tan(x); }
12+
inline float asin(float x) { return ::std::asin(x); }
13+
inline float acos(float x) { return ::std::acos(x); }
14+
inline float atan(float x) { return ::std::atan(x); }
15+
inline float atan2(float y, float x) { return ::std::atan2(y,x); }
16+
inline float abs(float x) { return ::std::abs(x); }
17+
inline float floor(float x) { return ::std::floor(x); }
18+
inline float ceil(float x) { return ::std::ceil(x); }
19+
inline float round(float x) { return ::std::round(x); }
20+
inline float sqrt(float x) { return ::std::sqrt(x); }
21+
inline float pow(float a, float b) { return ::std::pow(a,b); }
22+
inline float exp(float x) { return ::std::exp(x); }
23+
inline float log(float x) { return ::std::log(x); }
924
inline float radians(float d) { return PApplet::radians(d); }
1025
inline float degrees(float r) { return PApplet::degrees(r); }
1126
inline float sq(float x) { return PApplet::sq(x); }

0 commit comments

Comments
 (0)