Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
docking
ocladock
Commits
33cc7dde
Commit
33cc7dde
authored
Jul 05, 2018
by
lvs
Browse files
corrected-removed remainder by fmod for grads
parent
5bee4015
Changes
1
Hide whitespace changes
Inline
Side-by-side
device/calcgradient.cl
View file @
33cc7dde
...
...
@@ -1032,10 +1032,10 @@ void gpu_calc_gradient(
target_theta = acos(rotaxis_z);
if (is_theta_gt_pi == false) {
target_phi =
remainder
((atan2( rotaxis_y, rotaxis_x) + PI_TIMES_2), PI_TIMES_2);
target_phi =
fmod
((atan2( rotaxis_y, rotaxis_x) + PI_TIMES_2), PI_TIMES_2);
}
else {
target_phi =
remainder
((atan2(-rotaxis_y, -rotaxis_x) + PI_TIMES_2), PI_TIMES_2);
target_phi =
fmod
((atan2(-rotaxis_y, -rotaxis_x) + PI_TIMES_2), PI_TIMES_2);
target_theta = PI_TIMES_2 - target_theta;
}
...
...
@@ -1064,9 +1064,9 @@ void gpu_calc_gradient(
grad_theta = orientation_scaling * (target_theta - current_theta);
grad_rotangle = orientation_scaling * (target_rotangle - current_rotangle);
*/
grad_phi = orientation_scaling * (
remainder
(target_phi - current_phi + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
grad_theta = orientation_scaling * (
remainder
(target_theta - current_theta + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
grad_rotangle = orientation_scaling * (
remainder
(target_rotangle - current_rotangle + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
grad_phi = orientation_scaling * (
fmod
(target_phi - current_phi + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
grad_theta = orientation_scaling * (
fmod
(target_theta - current_theta + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
grad_rotangle = orientation_scaling * (
fmod
(target_rotangle - current_rotangle + PI_FLOAT, PI_TIMES_2) - PI_FLOAT);
#if defined (DEBUG_GRAD_ROTATION_GENES)
printf("\n%s\n", "----------------------------------------------------------");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment