Lines Matching refs:degrees

103         // Prepare mapping to snap touchable degrees to selectable degrees.
218 * Split up the 360 degrees of the circle among the 60 selectable values. Assigns a larger
221 * E.g. the output of 30 degrees should have a higher range of input associated with it than
222 * the output of 24 degrees, because 30 degrees corresponds to a visible number on the clock
227 // output will correspond to a range of 14 associated input degrees, and each non-visible
228 // output will correspond to a range of 4 associate input degrees, so visible numbers
232 // If an output of 30 degrees should correspond to a range of 14 associated degrees, then
235 // can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
236 // inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
249 for (int degrees = 0; degrees < 361; degrees++) {
251 SNAP_PREFER_30S_MAP[degrees] = snappedOutputDegrees;
271 * Returns mapping of any input degrees (0 to 360) to one of 60 selectable output degrees,
272 * where the degrees corresponding to visible numbers (i.e. those divisible by 30) will be
273 * weighted heavier than the degrees corresponding to non-visible numbers.
277 private static int snapPrefer30s(int degrees) {
281 return SNAP_PREFER_30S_MAP[degrees];
285 * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all
286 * multiples of 30), where the input will be "snapped" to the closest visible degrees.
287 * @param degrees The input degrees
291 * @return output degrees, will be a multiple of 30
293 private static int snapOnly30s(int degrees, int forceHigherOrLower) {
295 int floor = (degrees / stepSize) * stepSize;
298 degrees = ceiling;
300 if (degrees == floor) {
303 degrees = floor;
305 if ((degrees - floor) < (ceiling - degrees)) {
306 degrees = floor;
308 degrees = ceiling;
311 return degrees;
494 final int degrees = (hour % 12) * DEGREES_FOR_ONE_HOUR;
495 mSelectionDegrees[HOURS] = degrees;
524 private int getHourForDegrees(int degrees, boolean innerCircle) {
525 int hour = (degrees / DEGREES_FOR_ONE_HOUR) % 12;
583 private int getMinuteForDegrees(int degrees) {
584 return degrees / DEGREES_FOR_ONE_MINUTE;
940 // Convert to degrees.
941 final int degrees = (int) (Math.toDegrees(Math.atan2(dY, dX) + Math.PI / 2) + 0.5);
942 if (degrees < 0) {
943 return degrees + 360;
945 return degrees;
997 final int degrees = getDegreesFromXY(x, y, false);
998 if (degrees == -1) {
1010 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
1018 final int snapDegrees = snapPrefer30s(degrees) % 360;
1061 final int degrees = getDegreesFromXY(event.getX(), event.getY(), false);
1062 if (degrees != -1) {
1150 final int degrees = getDegreesFromXY(x, y, true);
1151 if (degrees != -1) {
1152 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
1160 final int touched = getMinuteForDegrees(degrees);
1183 * Returns the difference in degrees between two values along a circle.
1316 final float degrees;
1327 degrees = getDegreesForHour(value);
1330 degrees = getDegreesForMinute(value);
1335 degrees = 0;
1339 final double radians = Math.toRadians(degrees);