New Post

Markov Chains || Step-By-Step || ~xRay Pixy

Image
Learn Markov Chains step-by-step using real-life examples. Video Chapters: Markov Chains 00:00 Introduction 00:19 Topics Covered 01:49 Markov Chains Applications 02:04 Markov Property 03:18 Example 1 03:54 States, State Space, Transition Probabilities 06:17 Transition Matrix 08:17 Example 02 09:17 Example 03 10:26 Example 04 12:25 Example 05 14:16 Example 06 16:49 Example 07 18:11 Example 08 24:56 Conclusion

JavaScript Analog Clock || Step-By-Step || ~xRay Pixy


---------------------------- clock.html ---------------------------------------

<html>
<head>
<title>Javascript Analog Clock</title>
<link rel ="stylesheet" href="clock.css">
<script src = "clock.js"></script>
</head>
<body>
<div id="clockBox">
     <div id="hour"></div>
     <div id="minute"></div>
     <div id="second"></div>
     <div id="point"></div>
</div>
</body>
</html>


------------------------------ clock.css -----------------------------------------
#clockbox{
          height: 650px;
          width: 650px;
          background: url(clc.png);
          background-size:100%;
          margin:auto;
       
}
#hour, #minute, #second{
                        position:absolute;
                        background:red;
                        border-radius:15px;
                        transform-origin:bottom;
}

#hour{
                        width:1.6%;
                        height:25%;
                        left:48.85%;
                        top: 25%;
                        
}
#minute{
                        width: 1.4%;
                        height:30%;
                        left: 48.9%;
                        top:18%;
                        
}

#second{
                        width:0.8%;
                        height:36%;
                        top: 9%;
                        left: 49.25%;
                          
}

              
---------------------------- clock.js ---------------------------------------------------

setInterval(() => {
                       D = new Date();
                       H = D.getHours();
                       M = D.getMinutes();
                       S = D.getSeconds();
                       
                       H_rotation = 30 * H + M / 2;
                       M_rotation = 6 * M;
                       S_rotation = 6 * S;
                       
                       hour.style.transform =`rotate(${H_rotation}deg)`;
                       minute.style.transform =`rotate(${M_rotation}deg)`;
                       second.style.transform =`rotate(${S_rotation}deg)`;
                     
},1000);

Comments

Popular Post

PARTICLE SWARM OPTIMIZATION ALGORITHM NUMERICAL EXAMPLE

Cuckoo Search Algorithm for Optimization Problems

Particle Swarm Optimization (PSO)

PSO (Particle Swarm Optimization) Example Step-by-Step

how is the LBP |Local Binary Pattern| values calculated? Step-by-Step with Example

PSO Python Code || Particle Swarm Optimization in Python || ~xRay Pixy

Grey Wolf Optimization Algorithm

Bat algorithm Explanation Step by Step with example

Grey Wolf Optimization Algorithm Numerical Example

Whale Optimization Algorithm Code Implementation || WOA CODE || ~xRay Pixy