code changes for release 2.2.0
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
#pragma TextEncoding = "UTF-8"
|
||||
#pragma rtGlobals=3
|
||||
#pragma version = 2.1
|
||||
#pragma version = 2.2
|
||||
#pragma IgorVersion = 6.1
|
||||
#pragma ModuleName = PearlVectorOperations
|
||||
|
||||
// copyright (c) 2011-17 Paul Scherrer Institut
|
||||
// copyright (c) 2011-21 Paul Scherrer Institut
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -21,7 +22,7 @@
|
||||
///
|
||||
/// @author matthias muntwiler, matthias.muntwiler@psi.ch
|
||||
///
|
||||
/// @copyright 2011-17 Paul Scherrer Institut @n
|
||||
/// @copyright 2011-21 Paul Scherrer Institut @n
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License"); @n
|
||||
/// you may not use this file except in compliance with the License. @n
|
||||
/// You may obtain a copy of the License at
|
||||
@ -176,16 +177,17 @@ function rotate_x_wave(inout, angle)
|
||||
wave inout
|
||||
variable angle
|
||||
|
||||
wave m_rotation_x = create_rotation_matrix_free()
|
||||
make /n=3/d/free w_temp_rotate_x
|
||||
variable ivec, nvec
|
||||
nvec = max(DimSize(inout, 1), 1)
|
||||
for (ivec = 0; ivec < nvec; ivec += 1)
|
||||
set_rotation_x(m_rotation_x, angle)
|
||||
w_temp_rotate_x = inout[p][ivec]
|
||||
matrixop /free w_temp_rotate_x_result = m_rotation_x x w_temp_rotate_x
|
||||
inout[0,2][ivec] = w_temp_rotate_x_result[p]
|
||||
wave m_rotation = create_rotation_matrix_free()
|
||||
set_rotation_x(m_rotation, angle)
|
||||
|
||||
duplicate /free inout, out
|
||||
out = 0
|
||||
variable j
|
||||
for (j = 0; j < 3; j += 1)
|
||||
out += m_rotation[p][j] * inout[j][q]
|
||||
endfor
|
||||
|
||||
inout = out
|
||||
end
|
||||
|
||||
/// rotates a wave of 3-vectors about the y axis
|
||||
@ -204,16 +206,17 @@ function rotate_y_wave(inout, angle)
|
||||
wave inout
|
||||
variable angle
|
||||
|
||||
wave m_rotation_y = create_rotation_matrix_free()
|
||||
make /n=3/d/free w_temp_rotate_y
|
||||
variable ivec, nvec
|
||||
nvec = max(DimSize(inout, 1), 1)
|
||||
for (ivec = 0; ivec < nvec; ivec += 1)
|
||||
set_rotation_y(m_rotation_y, angle)
|
||||
w_temp_rotate_y = inout[p][ivec]
|
||||
matrixop /free w_temp_rotate_y_result = m_rotation_y x w_temp_rotate_y
|
||||
inout[0,2][ivec] = w_temp_rotate_y_result[p]
|
||||
endfor
|
||||
wave m_rotation = create_rotation_matrix_free()
|
||||
set_rotation_y(m_rotation, angle)
|
||||
|
||||
duplicate /free inout, out
|
||||
out = 0
|
||||
variable j
|
||||
for (j = 0; j < 3; j += 1)
|
||||
out += m_rotation[p][j] * inout[j][q]
|
||||
endfor
|
||||
|
||||
inout = out
|
||||
end
|
||||
|
||||
/// rotates a wave of 3-vectors about the z axis
|
||||
@ -232,14 +235,15 @@ function rotate_z_wave(inout, angle)
|
||||
wave inout
|
||||
variable angle
|
||||
|
||||
wave m_rotation_z = create_rotation_matrix_free()
|
||||
make /n=3/d/free w_temp_rotate_z
|
||||
variable ivec, nvec
|
||||
nvec = max(DimSize(inout, 1), 1)
|
||||
for (ivec = 0; ivec < nvec; ivec += 1)
|
||||
set_rotation_z(m_rotation_z, angle)
|
||||
w_temp_rotate_z = inout[p][ivec]
|
||||
matrixop /free w_temp_rotate_z_result = m_rotation_z x w_temp_rotate_z
|
||||
inout[0,2][ivec] = w_temp_rotate_z_result[p]
|
||||
endfor
|
||||
wave m_rotation = create_rotation_matrix_free()
|
||||
set_rotation_z(m_rotation, angle)
|
||||
|
||||
duplicate /free inout, out
|
||||
out = 0
|
||||
variable j
|
||||
for (j = 0; j < 3; j += 1)
|
||||
out += m_rotation[p][j] * inout[j][q]
|
||||
endfor
|
||||
|
||||
inout = out
|
||||
end
|
||||
|
Reference in New Issue
Block a user