mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
28 lines
445 B
Plaintext
28 lines
445 B
Plaintext
import math;
|
|
|
|
// test toRad
|
|
{
|
|
assert toRad(0) == 0, "toRad 0° failed";
|
|
assert toRad(180) == PI, "toRad 180° failed";
|
|
assert toRad(360) == 2 * PI, "toRad 360° failed";
|
|
}
|
|
|
|
|
|
// test toDeg
|
|
{
|
|
assert toDeg(0) == 0, "toDeg 0 failed";
|
|
assert toDeg(PI) == 180, "toDeg π failed";
|
|
assert toDeg(2 * PI) == 360, "toDeg 2π failed";
|
|
}
|
|
|
|
// test sin
|
|
{
|
|
assert sin(PI) == 0, "sin π failed";
|
|
}
|
|
|
|
|
|
// test cos
|
|
{
|
|
assert cos(PI) == -1, "cos π failed";
|
|
}
|