01-08-2016, 09:36 AM
Post: #1
 AlfaSierra Junior Member Posts: 1 Joined: Dec 2015
Hi to everybody!
I created a small program that provides conversion from radians or degrees to gradian and viceversa. There are also the three basic trigonometric functions and their inverse functions that work directly in gradians.
I hope it is useful to someone. If there are errors and bugs report it!

Code:
 // Gradian Toolbox // January 2016 // HAngle = 1 -> degrees mode // HAngle = 0 -> radian mode // Exact function removes approximation error // Approx function convert decimal value to fraction whenever possible // Converting to grads EXPORT TO_GRAD(n) BEGIN IF HAngle == 1 THEN  RETURN 10*n/9; ELSE  RETURN 200*n/π; END; END; // Convert from grads EXPORT FROM_GRAD(n) BEGIN IF HAngle == 1 THEN  RETURN 9*n/10;  ELSE  RETURN n*π/200; END; END; // Grads cosine EXPORT COS_G(n) BEGIN RETURN COS(FROM_GRAD(n)); END; // Grads sine EXPORT SIN_G(n) BEGIN RETURN SIN(FROM_GRAD(n)); END; // Grads tangent EXPORT TAN_G(n) BEGIN RETURN TAN(FROM_GRAD(n)); END; // Grads arccosine EXPORT ACOS_G(n) BEGIN IF HAngle == 1 THEN  RETURN approx(exact(10*ACOS(n)/9)); ELSE  RETURN approx(exact(200*ACOS(n)/π)); END; END; // Grads arcsine EXPORT ASIN_G(n) BEGIN IF HAngle == 1 THEN  RETURN approx(exact(10*ASIN(n)/9)); ELSE  RETURN approx(exact(200*ASIN(n)/π)); END; END; // Grads arctangent EXPORT ATAN_G(n) BEGIN IF HAngle == 1 THEN  RETURN approx(exact(10*ATAN(n)/9)); ELSE  RETURN approx(exact(200*ATAN(n)/π)); END; END;
01-08-2016, 06:41 PM
Post: #2
 salvomic Senior Member Posts: 1,379 Joined: Jan 2015
thank you! very useful. Gradian should be an option in the Prime, like degree and radiants!

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
01-09-2016, 09:52 PM
Post: #3
 rprosperi Senior Member Posts: 4,456 Joined: Dec 2013
(01-08-2016 06:41 PM)salvomic Wrote:  thank you! very useful.

Useful for what? I am not questioning you, I just have no idea who still uses GRADS and for what purpose? I believe Surveying used them, but I've heard that has not been true for many years.

--Bob Prosperi
01-09-2016, 10:06 PM
Post: #4
 salvomic Senior Member Posts: 1,379 Joined: Jan 2015
(01-09-2016 09:52 PM)rprosperi Wrote:  Useful for what? I am not questioning you, I just have no idea who still uses GRADS and for what purpose? I believe Surveying used them, but I've heard that has not been true for many years.

military people use (used?) gradian in their operations...
I can still see gradian examples in old Italian Mathematics's books.
However I mean: it's useful to have in the Prime also Gradian (not only Degree and Radians): better many than few

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
01-10-2016, 01:47 AM
Post: #5
 Archanus Junior Member Posts: 49 Joined: Dec 2014