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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment