Skip to content

Instantly share code, notes, and snippets.

@amitkhare
Created November 7, 2019 05:20
Show Gist options
  • Save amitkhare/d35d1ccb7c84ab600f7348e9f5c53f7c to your computer and use it in GitHub Desktop.
Save amitkhare/d35d1ccb7c84ab600f7348e9f5c53f7c to your computer and use it in GitHub Desktop.
var maxValue = 500;
var maxAngle = 180;
var minAngle = 0;
var rotation = (maxAngle/maxValue * a);
rotation = (rotation >= maxAngle) ? maxAngle : rotation;
result = (rotation <= minAngle) ? minAngle : rotation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment