mcnp_matrix_rotations: Rotation matrices for transformations in MCNP

Description Usage Arguments Value See Also Examples

View source: R/mcnp_matrix_rotations.R

Description

Create 3 x 3 rotation matrix in cosines of the angles between the main and auxiliary coordinate systems in the form: xx' yx' zx' xy' yy' zy' xz' yz' zz'

Usage

1
mcnp_matrix_rotations(rot.axis, angle_degrees)

Arguments

rot.axis

axis of rotation

angle_degrees

degree of rotation

Value

rotational matrix for copy and paste to MCNP input

See Also

Other mcnp tools: mcnp_cone_angle(), mcnp_est_nps(), mcnp_plot_out_spec(), mcnp_scan2plot(), mcnp_scan_save(), mcnp_si_sp_RD(), mcnp_si_sp_hist_scan(), mcnp_si_sp_hist()

Examples

1
2
3
4
5
6
mcnp_matrix_rotations("x", 30)
mcnp_matrix_rotations("y", 7)
mcnp_matrix_rotations("z", 15)
# For combined rotations, use matrix multiplication (%*%)
# rotate 45 degrees on x-axis and 45 degrees on y-axis
mcnp_matrix_rotations("x", 45) %*% mcnp_matrix_rotations("y", 45)

Example output

sh: 1: cannot create /dev/null: Permission denied
     [,1]      [,2]       [,3]
[1,]    1 0.0000000  0.0000000
[2,]    0 0.8660254 -0.5000000
[3,]    0 0.5000000  0.8660254
           [,1] [,2]      [,3]
[1,]  0.9925462    0 0.1218693
[2,]  0.0000000    1 0.0000000
[3,] -0.1218693    0 0.9925462
          [,1]       [,2] [,3]
[1,] 0.9659258 -0.2588190    0
[2,] 0.2588190  0.9659258    0
[3,] 0.0000000  0.0000000    1
           [,1]      [,2]       [,3]
[1,]  0.7071068 0.0000000  0.7071068
[2,]  0.5000000 0.7071068 -0.5000000
[3,] -0.5000000 0.7071068  0.5000000

radsafer documentation built on April 13, 2021, 1:06 a.m.