Last active
February 18, 2016 12:00
-
-
Save dilnei/c5b525443f5ea49b2d5f to your computer and use it in GitHub Desktop.
retorna os graus do ponteiro do relogio em determinado date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package br.com.breakcaptcha.utils; | |
| import java.util.Date; | |
| /** | |
| * | |
| * @author Dilnei | |
| */ | |
| public class Degree { | |
| public static void main(String args[]) { | |
| System.out.println(new NewClass().returnsDegree(new Date())); | |
| } | |
| private int returnsDegree(Date d) { | |
| int hour = 360 / 12 * d.getHours(); | |
| int min = 360 / 60 * d.getMinutes(); | |
| return Math.abs(hour - min); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment