|
Post by u9 on Sept 12, 2007 7:40:31 GMT -5
ArcCos() gives division by zero when using the extreme-values.
I haven't checked ArcSin, so you should probably also look into that.
|
|
|
Post by Guilect on Sept 13, 2007 17:18:25 GMT -5
I have limited the output for ArcCos to 0 and 3.14159265358979
And 1.5707964 to -1.5707964 for ArcSin
|
|
|
Post by u9 on Sept 14, 2007 5:25:10 GMT -5
I'm sorry, i should have been more clear before. Because ArcCos is the inverse of cos() I think ArcCos is only defined in the range -1 to 1. But if i use -1 or 1 as an input to arccos() i get a division by zero error. Here is a graph of the two functions from wikipedia. The outputs should come naturally from the input upload.wikimedia.org/wikipedia/commons/4/41/Asin_acos_plot.svg
|
|
|
Post by Guilect on Sept 14, 2007 6:18:10 GMT -5
That's what I did.
Now if the input is > 1 or < -1 then the output of the function will not give error but rather the 1 or -1 output.
The output has to be limited as values do not exist for input ranges outside of 1 and -1.
|
|
|
Post by u9 on Sept 15, 2007 4:10:54 GMT -5
ah, ok. The problem was only that -1 and 1 were not included in the input range before, but this is also fine
|
|