Horizontal sundial calculations: Difference between revisions
Content added Content deleted
(→{{header|Java}}: Added missing variable declaration for 'hraRad'.) |
|||
Line 1,157: | Line 1,157: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
{{incorrect|Java|Compiler error.}} |
|||
{{trans|C}} (Substitutes in atan2 for the hour line angle calculation) |
{{trans|C}} (Substitutes in atan2 for the hour line angle calculation) |
||
<lang java>import java.util.Scanner; |
<lang java>import java.util.Scanner; |
||
public class Sundial { |
public class Sundial { |
||
public static void main(String[] args) { |
public static void main(String[] args) { |
||
Line 1,180: | Line 1,180: | ||
for (int h = -6; h <= 6; h++) { |
for (int h = -6; h <= 6; h++) { |
||
double hla, hra; |
double hla, hra, hraRad; |
||
hra = 15.0 * h; |
hra = 15.0 * h; |
||
hra = hra - lng + ref; |
hra = hra - lng + ref; |