21 gsl_vector *pGSLInputVector = gsl_vector_alloc(3);
22 gsl_vector_set(pGSLInputVector, 0,
x);
23 gsl_vector_set(pGSLInputVector, 1,
y);
24 gsl_vector_set(pGSLInputVector, 2,
z);
25 gsl_matrix *pRotationMatrix = gsl_matrix_alloc(3, 3);
26 gsl_matrix_set(pRotationMatrix, 0, 0, cos(
Angle));
27 gsl_matrix_set(pRotationMatrix, 0, 1, 0.0);
28 gsl_matrix_set(pRotationMatrix, 0, 2, sin(
Angle));
29 gsl_matrix_set(pRotationMatrix, 1, 0, 0.0);
30 gsl_matrix_set(pRotationMatrix, 1, 1, 1.0);
31 gsl_matrix_set(pRotationMatrix, 1, 2, 0.0);
32 gsl_matrix_set(pRotationMatrix, 2, 0, -sin(
Angle));
33 gsl_matrix_set(pRotationMatrix, 2, 1, 0.0);
34 gsl_matrix_set(pRotationMatrix, 2, 2, cos(
Angle));
35 gsl_vector *pGSLOutputVector = gsl_vector_alloc(3);
36 gsl_vector_set_zero(pGSLOutputVector);
37 gsl_blas_dgemv(CblasNoTrans, 1.0, pRotationMatrix, pGSLInputVector, 0.0, pGSLOutputVector);
38 x = gsl_vector_get(pGSLOutputVector, 0);
39 y = gsl_vector_get(pGSLOutputVector, 1);
40 z = gsl_vector_get(pGSLOutputVector, 2);
41 gsl_vector_free(pGSLInputVector);
42 gsl_vector_free(pGSLOutputVector);
43 gsl_matrix_free(pRotationMatrix);