Convert gist to code block
enginebai opened this issue · 0 comments
enginebai commented
to
private double convertTouchEventPointToAngle(float xPos, float yPos) {
// transform touch coordinate into component coordinate
float x = xPos - mTranslateX;
float y = yPos - mTranslateY;
x = (mClockwise) ? x : -x;
double angle = Math.toDegrees(Math.atan2(y, x) + (Math.PI / 2));
angle = (angle < 0) ? (angle + 360) : angle;
return angle;
}