forked from PencilCode/jquery-turtle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumeric_functions.html
More file actions
77 lines (70 loc) · 1.68 KB
/
numeric_functions.html
File metadata and controls
77 lines (70 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<script src="lib/qunit.js"></script>
<link href="lib/qunit.css" rel="stylesheet">
<script src="lib/jquery.js"></script>
<script src="../jquery-turtle.js"></script>
<body>
<div id="qunit"></div>
<script>
eval($.turtle());
module("Numeric functions test.");
asyncTest("Tests special values of functions.", function() {
ok(sin(0) === 0);
ok(cos(0) === 1);
ok(tan(0) === 0);
ok(asin(0) === 0);
ok(acos(1) === 0);
ok(atan(0) === 0);
ok(sind(0) === 0);
ok(sind(30) === .5);
ok(sind(90) === 1);
ok(sind(150) === .5);
ok(sind(180) === 0);
ok(sind(210) === -.5);
ok(sind(270) === -1);
ok(sind(330) === -.5);
ok(sind(360) === 0);
ok(cosd(0) === 1);
ok(cosd(60) === .5);
ok(cosd(90) === 0);
ok(cosd(120) === -.5);
ok(cosd(180) === -1);
ok(cosd(240) === -.5);
ok(cosd(270) === 0);
ok(cosd(300) === .5);
ok(tand(0) === 0);
ok(tand(45) === 1);
ok(tand(90) === Infinity);
ok(tand(135) === -1);
ok(tand(180) === 0);
ok(tand(225) === 1);
ok(tand(270) === -Infinity);
ok(tand(315) === -1);
ok(tand(360) === 0);
ok(asind(0) === 0);
ok(asind(.5) === 30);
ok(asind(1) === 90);
ok(asind(-.5) === -30);
ok(asind(-1) === -90);
ok(acosd(1) === 0);
ok(acosd(.5) === 60);
ok(acosd(0) === 90);
ok(acosd(-.5) === 120);
ok(acosd(-1) === 180);
ok(atand(0) === 0);
ok(atand(1) === 45);
ok(atand(Infinity) === 90);
ok(atand(-1) === -45);
ok(atand(0, 1) === 0);
ok(atand(1, 1) === 45);
ok(atand(Infinity, 1) === 90);
ok(atand(-1, 1) === -45);
ok(atand(0, -1) === 180);
ok(atand(1, -1) === 135);
ok(atand(-Infinity) === -90);
ok(atand(-Infinity, 1) === -90);
ok(atand(-1, -1) === -135);
done(function() {
start();
});
});
</script>