ZCubes/Clock Angle Problem

From ZCubes Wiki
Jump to navigation Jump to search

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.