Rotate Image
How do I make an rotate image?
Rotate an NxN image by 90 degrees.. What is a rotate image? How do you make a rotate image? This script and codes were developed by Mnicpt on 30 July 2022, Saturday.
Rotate Image - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rotate Image</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="console"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Rotate Image - Script Codes JS Codes
function rotateClockwise90(matrix) { var i = 0, layer = 0, top, offset; for (layer; layer < matrix.length / 2; layer++) { var first = layer; var last = matrix.length - 1 - layer; for (i = first; i < last; i++) { offset = i - first; //save top top = matrix[first][i]; //left -> top matrix[first][i] = matrix[last - offset][first]; //bottom -> left matrix[last - offset][first] = matrix[last][last - offset]; //right -> bottom matrix[last][last - offset] = matrix[i][last]; //top -> right matrix[i][last] = top; } } return matrix;
}
var console = document.querySelector(".console"), rotatedMatrix, matrix = [[1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16]];
rotatedMatrix = rotateClockwise90(matrix);
console.innerHTML = rotatedMatrix;
Developer | Mnicpt |
Username | mnicpt |
Uploaded | July 30, 2022 |
Rating | 3 |
Size | 1,843 Kb |
Views | 48,576 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Solve Intersecting Lines | 1,792 Kb |
Fading Divider | 1,728 Kb |
Angular Calculator | 3,616 Kb |
Contact Snippet | 1,815 Kb |
First 100 Prime Numbers | 1,615 Kb |
Model View Sync | 1,733 Kb |
Mastermind | 5,601 Kb |
Quick Sort | 7,584 Kb |
Plain JavaScript Calculator | 3,600 Kb |
3,268 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
JQuery AJAX reddit Exercise | Btholt | 1,777 Kb |
Medium Menu | Lucasmotta | 3,923 Kb |
Slim Grid SASS SCSS v3.2 | Thesturs | 4,709 Kb |
Gradient-ui-button-mark-fx | Tabspace | 1,881 Kb |
Brown by pure CSS, no image, no javascript | Aaronchuo | 2,652 Kb |
Animation | B3ST1156 | 1,584 Kb |
Animated bar chart | CreativePunch | 3,124 Kb |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
Voting App - register | MatheusLima92 | 1,948 Kb |
Formations | Cantelope | 5,731 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!