I am trying to print the next results on my terminal but something happens when I try placing the cos()
function inside the asin()
. This is my code:
#include "stdio.h"
#include "math.h"
int main() {
float R7, R4, Roc2Y;
//Calculo de los angulos
Roc2Y = asin(-R7) * 180.0 / PI;
Roc2Z = asin(R4 / cos(Roc2Y)) * 180.0 / PI;
printf("\n"); //Linea en blanco
printf(" Resultado: \n");
printf(" Angulo r7 \n");
printf(" RY=%f\n", Roc2Y );
printf(" RZ=%f\n", Roc2Z ) ;
}
And this is what it prints out on terminal:
Resultado:
Angulo r7
RY=11.506551
RZ=nan
Some help would be appreciated!! Thanks in advance :)