File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import "Math/Core";
2
2
3
3
namespace Math;
4
4
5
+ /%
6
+ The result of @"PI" / 180.
7
+ %/
8
+ const dec DEG_TO_RAD = 0.017453292519943;
9
+
5
10
/%
6
11
@approx: This function uses the Taylor series expansion of sine. This function
7
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
}
You can’t perform that action at this time.
0 commit comments