We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0ea3b3 commit 10ce0f5Copy full SHA for 10ce0f5
Math/Trig.scope
@@ -2,6 +2,11 @@ import "Math/Core";
2
3
namespace Math;
4
5
+/%
6
+The result of @"PI" / 180.
7
+%/
8
+const dec DEG_TO_RAD = 0.017453292519943;
9
+
10
/%
11
@approx: This function uses the Taylor series expansion of sine. This function
12
is not 100% accurate but will provide a very good approximation.
@@ -119,4 +124,18 @@ Please note that an input of @"PI" **will not** return *exactly* `0.0`.
119
124
%/
120
125
func dec cot(dec x) {
121
126
ret 1.0 / tan(x);
127
+}
128
129
130
+Returns @"degrees" converted into radians.
131
132
+func dec degToRad(dec degrees) {
133
+ ret degrees * DEG_TO_RAD;
134
135
136
137
+Returns @"radians" converted into degrees.
138
139
+func dec radToDeg(dec radians) {
140
+ ret radians / DEG_TO_RAD;
122
141
}
0 commit comments