From caf0e0508236e5b37b826c8c54efe23fb7158eff Mon Sep 17 00:00:00 2001 From: Pratush Rai Date: Wed, 4 Oct 2023 05:04:15 +0530 Subject: [PATCH 1/2] line: 18 approximation of sin(a) -> approximation of cos(a) --- vlib/math/math.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/math/math.v b/vlib/math/math.v index f838f012a895fb..92e37ef0b262c8 100644 --- a/vlib/math/math.v +++ b/vlib/math/math.v @@ -16,7 +16,7 @@ pub fn aprox_sin(a f64) f64 { return a0 + a * (a1 + a * (a2 + a * (a3 + a * (a4 + a * (a5 + a * (a6 + a * a7)))))) } -// aprox_cos returns an approximation of sin(a) made using lolremez +// aprox_cos returns an approximation of cos(a) made using lolremez pub fn aprox_cos(a f64) f64 { a0 := 9.9995999154986614e-1 a1 := 1.2548995793001028e-3 From 8083744d1e8991ade1b2b5cc8650a2ce509c0137 Mon Sep 17 00:00:00 2001 From: Pratush Rai Date: Wed, 4 Oct 2023 05:12:05 +0530 Subject: [PATCH 2/2] improved docstring for radian and degrees function --- vlib/math/math.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/math/math.v b/vlib/math/math.v index 92e37ef0b262c8..404fbc21bc8bbe 100644 --- a/vlib/math/math.v +++ b/vlib/math/math.v @@ -36,7 +36,7 @@ pub fn copysign(x f64, y f64) f64 { return f64_from_bits((f64_bits(x) & ~sign_mask) | (f64_bits(y) & sign_mask)) } -// degrees converts from radians to degrees. +// degrees converts angle from radians to degrees. [inline] pub fn degrees(radians f64) f64 { return radians * (180.0 / pi) @@ -153,7 +153,7 @@ pub fn signi(n f64) int { return int(copysign(1.0, n)) } -// radians converts from degrees to radians. +// radians converts angle from degrees to radians. [inline] pub fn radians(degrees f64) f64 { return degrees * (pi / 180.0)