Lines Matching refs:degrees

94         // Prepare mapping to snap touchable degrees to selectable degrees.
193 * Split up the 360 degrees of the circle among the 60 selectable values. Assigns a larger
196 * E.g. the output of 30 degrees should have a higher range of input associated with it than
197 * the output of 24 degrees, because 30 degrees corresponds to a visible number on the clock
202 // output will correspond to a range of 14 associated input degrees, and each non-visible
203 // output will correspond to a range of 4 associate input degrees, so visible numbers
207 // If an output of 30 degrees should correspond to a range of 14 associated degrees, then
210 // can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
211 // inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
224 for (int degrees = 0; degrees < 361; degrees++) {
226 SNAP_PREFER_30S_MAP[degrees] = snappedOutputDegrees;
246 * Returns mapping of any input degrees (0 to 360) to one of 60 selectable output degrees,
247 * where the degrees corresponding to visible numbers (i.e. those divisible by 30) will be
248 * weighted heavier than the degrees corresponding to non-visible numbers.
252 private static int snapPrefer30s(int degrees) {
256 return SNAP_PREFER_30S_MAP[degrees];
260 * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all
261 * multiples of 30), where the input will be "snapped" to the closest visible degrees.
262 * @param degrees The input degrees
266 * @return output degrees, will be a multiple of 30
268 private static int snapOnly30s(int degrees, int forceHigherOrLower) {
270 int floor = (degrees / stepSize) * stepSize;
273 degrees = ceiling;
275 if (degrees == floor) {
278 degrees = floor;
280 if ((degrees - floor) < (ceiling - degrees)) {
281 degrees = floor;
283 degrees = ceiling;
286 return degrees;
469 final int degrees = (hour % 12) * DEGREES_FOR_ONE_HOUR;
470 mSelectionDegrees[HOURS] = degrees;
499 private int getHourForDegrees(int degrees, boolean innerCircle) {
500 int hour = (degrees / DEGREES_FOR_ONE_HOUR) % 12;
558 private int getMinuteForDegrees(int degrees) {
559 return degrees / DEGREES_FOR_ONE_MINUTE;
915 // Convert to degrees.
916 final int degrees = (int) (Math.toDegrees(Math.atan2(dY, dX) + Math.PI / 2) + 0.5);
917 if (degrees < 0) {
918 return degrees + 360;
920 return degrees;
972 final int degrees = getDegreesFromXY(x, y, false);
973 if (degrees == -1) {
985 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
993 final int snapDegrees = snapPrefer30s(degrees) % 360;
1113 final int degrees = getDegreesFromXY(x, y, true);
1114 if (degrees != -1) {
1115 final int snapDegrees = snapOnly30s(degrees, 0) % 360;
1123 final int touched = getMinuteForDegrees(degrees);
1146 * Returns the difference in degrees between two values along a circle.
1279 final float degrees;
1290 degrees = getDegreesForHour(value);
1293 degrees = getDegreesForMinute(value);
1298 degrees = 0;
1302 final double radians = Math.toRadians(degrees);