Qibla direction
How do I make an qibla direction?
What is a qibla direction? How do you make a qibla direction? This script and codes were developed by Khalid Munir on 11 January 2023, Wednesday.
Qibla direction - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>qibla direction</title>
</head>
<body> <form> <table class="hel12" width="610"> <tbody> <tr> <td>Latitude (Decimal Deg)</td> <td><input type="text" name="Latitude">e.g., 39.4 ["+" North, "-" South)</td> </tr> <tr> <td>Longitude (Decimal Deg)</td> <td><input type="text" name="Longitude">e.g., -107.9 ["+" East, "-" West)</td> </tr> <tr> <td>Qibla from True North =</td> <td><span id="Qibla"></span></td> </tr> <tr> <td colspan="2" align="center"> <input type="button" value="Calculate" onclick="a=calculate(this.form.Latitude.value,this.form.Longitude.value);displayDirection(a);return false;"> <input type="button" value="Clear" onclick="this.form.reset();clearResult();return false"> </td> </tr> </tbody> </table>
</form> <script src="js/index.js"></script>
</body>
</html>
Qibla direction - Script Codes JS Codes
var PI = Math.PI;
var win = null;
function calculate(lat, lon) { if (isNaN(lat+0.0) || isNaN(lon+0.0)) { alert("Non-numeric entry/entries"); return "???"; } if ((lat-0.0)>(90.0-0.0) || (lat-0.0)<(-90.0-0.0)) { alert("Latitude must be between -90 and 90 degrees"); return "???"; } if ((lon-0.0)>(180.0-0.0) || (lon-0.0)<(-180.0-0.0)) { alert("Longitude must be between -180 and 180 degrees"); return "???"; } if ((lat+0.0==21.4) && (lon+0.0==39.8)) return "Any Direction"; latk = 21.4225*PI/180.0; longk = 39.8264*PI/180.0; phi = lat*PI/180.0; lambda = lon*PI/180.0; qiblad = 180.0/PI*Math.atan2(Math.sin(longk-lambda), Math.cos(phi)*Math.tan(latk)-Math.sin(phi)*Math.cos(longk-lambda)); console.log(qiblad); return (qiblad);
}
function clearResult()
{ if (document.getElementById) document.getElementById('Qibla').innerHTML=''; else if(document.all) document.all['Qibla'].innerText=''; else if (win) { win.close(); win = null; }
}
function displayDirection(a)
{ d = (a>=0? a+" degrees East of North" : -a+" degrees West of North"); if (document.getElementById) document.getElementById('Qibla').innerHTML = d; else if (document.all) document.all['Qibla'].innerText = d; else { win = open('','Result','width=200,height=75'); win.document.close(); win.document.write('Qibla direction is <br>'+d); }
}
Developer | Khalid Munir |
Username | khalidmunir |
Uploaded | January 11, 2023 |
Rating | 3 |
Size | 2,208 Kb |
Views | 2,024 |
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 |
Scroll button detect | 1,844 Kb |
Generate a dynamic table - javascript and HTML | 1,923 Kb |
Ng-Handson - simple example | 1,822 Kb |
NgHandsonTable - get value instead of formula | 2,317 Kb |
Single Image upload knockout | 1,696 Kb |
Broken Rule.js example1 | 3,541 Kb |
Masjid Timetable from Ajax source | 1,735 Kb |
CSS TRICKS - corner ribbon | 1,976 Kb |
Github 404 page is so cool | 127,015 Kb |
Part 3 - resizing height - bootstrap | 5,805 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 |
Realistic Buttons | Stoypenny | 2,248 Kb |
Buttons for autumn | Nikazawila | 1,795 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Popover Example | Seanboom | 2,429 Kb |
React Template | Isac | 1,241 Kb |
Board Site | IndianaLuft | 10,542 Kb |
Nested table email layout | Massimo-cassandro | 2,355 Kb |
Sticky div | Kaslab | 2,225 Kb |
Flex Table | Simeonoff | 4,059 Kb |
Guidepopup | Wooljs | 3,747 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!