Lines Matching refs:degrees

102         // Prepare mapping to snap touchable degrees to selectable degrees.
217 * Split up the 360 degrees of the circle among the 60 selectable values. Assigns a larger
220 * E.g. the output of 30 degrees should have a higher range of input associated with it than
221 * the output of 24 degrees, because 30 degrees corresponds to a visible number on the clock
226 // output will correspond to a range of 14 associated input degrees, and each non-visible
227 // output will correspond to a range of 4 associate input degrees, so visible numbers
231 // If an output of 30 degrees should correspond to a range of 14 associated degrees, then
234 // can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
235 // inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
248 for (int degrees = 0; degrees < 361; degrees++) {
250 SNAP_PREFER_30S_MAP[degrees] = snappedOutputDegrees;
270 * Returns mapping of any input degrees (0 to 360) to one of 60 selectable output degrees,
271 * where the degrees corresponding to visible numbers (i.e. those divisible by 30) will be
272 * weighted heavier than the degrees corresponding to non-visible numbers.
276 private static int snapPrefer30s(int degrees) {
280 return SNAP_PREFER_30S_MAP[degrees];
284 * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all
285 * multiples of 30), where the input will be "snapped" to the closest visible degrees.
286 * @param degrees The input degrees
290 * @return output degrees, will be a multiple of 30
292 private static int snapOnly30s(int degrees, int forceHigherOrLower) {
294 int floor = (degrees / stepSize) * stepSize;
297 degrees = ceiling;
299 if (degrees == floor) {
302 degrees = floor;
304 if ((degrees - floor) < (ceiling - degrees)) {
305 degrees = floor;
307 degrees = ceiling;
310 return degrees;
493 final int degrees = (hour % 12) * DEGREES_FOR_ONE_HOUR;
494 mSelectionDegrees[HOURS] = degrees;
523 private int getHourForDegrees(int degrees, boolean innerCircle) {
524 int hour = (degrees / DEGREES_FOR_ONE_HOUR) % 12;
582 private int getMinuteForDegrees(int degrees) {
583 return degrees / DEGREES_FOR_ONE_MINUTE;
939 // Convert to degrees.
940 final int degrees = (int) (Math.toDegrees(Math.atan2(dY, dX) + Math.PI / 2) + 0.5);
941 if (degrees < 0) {
942 return degrees + 360;
944 return degrees;
996 final int degrees = getDegreesFromXY(x, y, false);
997 if (degrees == -1) {
1009 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
1017 final int snapDegrees = snapPrefer30s(degrees) % 360;
1137 final int degrees = getDegreesFromXY(x, y, true);
1138 if (degrees != -1) {
1139 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
1147 final int touched = getMinuteForDegrees(degrees);
1170 * Returns the difference in degrees between two values along a circle.
1303 final float degrees;
1314 degrees = getDegreesForHour(value);
1317 degrees = getDegreesForMinute(value);
1322 degrees = 0;
1326 final double radians = Math.toRadians(degrees);