The cos-function y = cos(x) gives a value y which is from [-1 ... +1]. Its parameter x must be radians, that is for example -2*pi ... +2*pi, also values > 2*pi are allowed.

Therefore the parameter y of the restricted inverse function x = acos(y) must always be from [-1 ... +1]. x is then from restricted domain [pi .. 0] because cos is periodic.

As for your program:

>> a=Integer.parseInt (args[0]);
a can be a parameter for acos function if a is from [-1..+1]. If not, NaN would be the result.

>> b=(float)Math.acos(a*(180/3.14));
should be: b = Math.acos(a);
The result b is radians. You can convert it into degrees: b_degrees = b * 180 / pi or b_degrees = Math.acos(a) * 180 / pi, where pi = 3.14159265358979 or 4*atan(1).

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :