Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert gist to code block #1

Closed
enginebai opened this issue Dec 13, 2016 · 0 comments
Closed

Convert gist to code block #1

enginebai opened this issue Dec 13, 2016 · 0 comments
Assignees
Labels

Comments

@enginebai
Copy link
Owner

enginebai commented Dec 13, 2016

2016-12-13 11 37 51

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;
}
@enginebai enginebai self-assigned this Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant