computeGradientAlignmentX function
Implementation
double computeGradientAlignmentX(double evaluatedAngle) {
evaluatedAngle %= 360;
final rads = evaluatedAngle * pi / 180;
double x;
if (evaluatedAngle < 45 || evaluatedAngle > 315) {
x = sin(2 * rads);
} else if (45 <= evaluatedAngle && evaluatedAngle <= 135) {
x = 1;
} else if (135 <= evaluatedAngle && evaluatedAngle <= 225) {
x = sin(-2 * rads);
} else {
x = -1;
}
return double.parse(roundTo(x, 2));
}