treeform 2021-11-20 22:14:44 -08:00
parent b11891e6ec
commit 98f8485ff0
2 changed files with 6 additions and 1 deletions

View file

@ -422,7 +422,7 @@ proc toRadians*[T: SomeFloat](deg: T): T =
proc toDegrees*[T: SomeFloat](rad: T): T =
## Convert radians to degrees.
fixAngle(180.0 * rad / PI)
180.0 * rad / PI
proc toRadians*(deg: SomeInteger): float32 =
## Convert degrees to radians.

View file

@ -899,3 +899,8 @@ block:
doAssert vec4(uvec4(17, 18, 19, 20)) == vec4(17, 18, 19, 20)
doAssert ivec4(uvec4(21, 22, 23, 24)) == ivec4(21, 22, 23, 24)
doAssert uvec4(ivec4(25, 26, 27, 28)) == uvec4(25, 26, 27, 28)
block:
# Test for https://github.com/treeform/vmath/issues/44
doAssert PI.toDegrees() == 180
doAssert (PI*2).toDegrees() == 360