Page 2 of 2

Posted: Mon May 08, 2006 12:47 pm
by djes
Kale wrote:
djes wrote:I prefer differents dedicated functions for this reason :

"Sin" and "cos" in radians
"Sinq" and "cosq" or anything else, like "sind" and "cosd" for degrees.
You misunderstand, my request was for an optional unit parameter to allow sin and cos to work with degrees. There is no need for seperate commands because when compiled the two different versions can be use behind the scenes. Just like the Plot(x, y) and plot(x, y, colour) commands where the first is not accelerated but the second is.
Ok for that :)

Example : cos(angle,[deg]) : if deg==true, angle is in degrees, else in radians

Posted: Mon May 08, 2006 1:24 pm
by josku_x
That would be indeed useful. An optional parameter which Kale mentioned firstly in his post

Posted: Tue May 09, 2006 4:57 pm
by DoubleDutch
imho this should be adopted on all maths commands - some like:

Code: Select all

Result.f = ACos(Value.f,#PB_Degrees)
Returns the Arc-Cosinus of the specified value. Value.f must be between -1 and 1, the result will be in degrees

or alternatively do like the 8-bits did. Have a command to shift all future maths commands to degrees and vice versa.

Code: Select all

Deg()
All future maths commands use/return in degrees.

Code: Select all

Rad()
All future maths commands use/return in radians.

The default being radians.

-Anthony

Posted: Tue May 09, 2006 5:45 pm
by Kale
This thread contains a lot of good ideas! :) But i guess the whole consensus of opinion is that it would be nice for the math functions to support both in some way, i guess the implementation is up to Fred & co. :D