Difference between revisions of "ZCubes/Clock Angle Problem"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "==Clock Angle Problem== <br/> This video demonstrates how to compute the times when the hour hand, minute hand and seconds hand come on top of each other. ZCubes enables you t...")
 
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
==Video==
 
==Video==
 
<br/>
 
<br/>
{{#ev:youtube|iDeL1T4jqag|480|left|Brocards Problem & Brown Numbers}}
+
{{#ev:youtube|iDeL1T4jqag|480|left|Clock Angle Problem}}
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  
 +
==ZCubes Code==
 +
<pre>
 +
hangle=360/12;
 +
mhangle=360/12/60;
 +
shangle=360/12/60/60;
 +
mangle=360/(60);
 +
smangle=360/(60)/60;
 +
sangle=360/(60);
 +
[0..11,0..59,0..59]
 +
@(
 +
function hm(h,m,s)
 +
{
 +
return(
 +
[h,m,s,
 +
ABS(
 +
(h*hangle+m*mhangle+s*shangle)
 +
-
 +
(m*mangle+s*smangle)
 +
)
 +
<=smangle/2.01  //2 //2.5
 +
]
 +
      )
 +
}
 +
  )
 +
.filter(r=>r[0][3]==true)
 +
</pre>
  
<<[[Main_Page | About ZCubes ]]
 
 
 
<br/>
 
<br/>
&copy; Copyright 1996-2020, ZCubes, Inc.
+
*[[Z3 | Z3 home]]
 +
*[[Z^3 Language Documentation]]
 +
*[[ZCubes_Videos | ZCubes Videos and Tutorials]]
 +
*[[Main_Page | About ZCubes ]]
 +
<br/>
 +
<br/>
 +
&copy; Copyright 1996-2021, ZCubes, Inc.

Latest revision as of 09:08, 16 September 2021

Clock Angle Problem


This video demonstrates how to compute the times when the hour hand, minute hand and seconds hand come on top of each other. ZCubes enables you to compute this using a few lines of easy code. Enjoy watching and try the code in ZCubes.

Video


Clock Angle Problem














ZCubes Code

hangle=360/12;
mhangle=360/12/60;
shangle=360/12/60/60;
mangle=360/(60);
smangle=360/(60)/60;
sangle=360/(60);
[0..11,0..59,0..59]
	@(
		function hm(h,m,s)
	{
			return(
				[h,m,s,
			ABS(
				(h*hangle+m*mhangle+s*shangle)
				-
				(m*mangle+s*smangle)
				)
				<=smangle/2.01  //2 //2.5
				]
			       )
		}
	  )
	.filter(r=>r[0][3]==true)




© Copyright 1996-2021, ZCubes, Inc.