{"id":372,"date":"2024-01-06T13:55:15","date_gmt":"2024-01-06T12:55:15","guid":{"rendered":"https:\/\/thetallguy.fr\/?page_id=372"},"modified":"2024-01-27T20:35:45","modified_gmt":"2024-01-27T19:35:45","slug":"astrophotographie","status":"publish","type":"page","link":"https:\/\/thetallguy.fr\/index.php\/astronomie\/astrophotographie\/","title":{"rendered":"Calculateur d&#8217;\u00e9l\u00e9vation pour la mise en station de la lunette astronomique"},"content":{"rendered":"\n<!DOCTYPE html>\n<html>\n<head>\n    <title>Calculateur d&#8217;Angle pour Lunette Astronomique<\/title>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            background-image: url('https:\/\/thetallguy.fr\/wp-content\/uploads\/2024\/01\/anglelunette.png'); \/* Assurez-vous que le chemin est correct *\/\n            background-size: cover;\n            text-align: center;\n            padding: 20px;\n        }\n\n        #inputContainer {\n            margin-bottom: 20px;\n        }\n\n        input[type=\"text\"] {\n            padding: 10px;\n            margin: 10px;\n            border: 1px solid #ddd;\n            border-radius: 4px;\n        }\n\n        #boutonCoordonnees {\n            background-color: #4CAF50;\n            border: none;\n            color: white;\n            padding: 10px 20px;\n            text-align: center;\n            text-decoration: none;\n            display: inline-block;\n            font-size: 16px;\n            margin: 4px 2px;\n            cursor: pointer;\n            box-shadow: 0 9px #999;\n        }\n\n        #boutonCoordonnees:active {\n            background-color: #3e8e41;\n            box-shadow: 0 5px #666;\n            transform: translateY(4px);\n        }\n\n        #canvas {\n            border: 1px solid #ddd;\n            background-color: #fff;\n            margin-top: 10px;\n        }\n\n        #informationsAPI, #angleInclinaison {\n            font-size: 18px;\n            color: #333;\n            margin: 20px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <!-- <h2>Calculateur d'Angle pour Lunette Astronomique<\/h2> -->\n\n    <div id=\"inputContainer\">\n        <input type=\"text\" id=\"numeroRue\" placeholder=\"Num&eacute;ro de la rue\">\n        <input type=\"text\" id=\"nomRue\" placeholder=\"Nom de la rue\">\n        <input type=\"text\" id=\"codePostal\" placeholder=\"Code Postal\">\n        <button id=\"boutonCoordonnees\" onclick=\"obtenirCoordonnees()\">Obtenir Coordonn&eacute;es<\/button>\n    <\/div>\n\n    <div id=\"informationsAPI\"><\/div>\n    <h3>Angle d&#8217;inclinaison: <span id=\"angleInclinaison\"><\/span> degr&eacute;s<\/h3>\n    <canvas id=\"canvas\" width=\"400\" height=\"200\"><\/canvas>\n\n\n    <script>\n        var latitude;\n\n        function obtenirCoordonnees() {\n            var numeroRue = document.getElementById(\"numeroRue\").value;\n            var nomRue = document.getElementById(\"nomRue\").value;\n            var codePostal = document.getElementById(\"codePostal\").value;\n\n            var url = `https:\/\/api-adresse.data.gouv.fr\/search\/?q=${numeroRue} ${nomRue} ${codePostal}`;\n\n            fetch(url)\n                .then(response => response.json())\n                .then(data => {\n                    latitude = data.features[0].geometry.coordinates[1];\n                    afficherInformations(data.features[0]);\n                    calculerEtAfficherAngle();\n                    dessinerScene();\n                })\n                .catch(error => console.log('Erreur : ' + error));\n        }\n\n        function afficherInformations(infos) {\n            var contenu = \"<h3>Informations de l'API :<\/h3>\";\n            for (var cle in infos.properties) {\n                contenu += cle + \" : \" + infos.properties[cle] + \"<br>\";\n            }\n            document.getElementById(\"informationsAPI\").innerHTML = contenu;\n        }\n\n        function calculerEtAfficherAngle() {\n            document.getElementById(\"angleInclinaison\").innerHTML = latitude.toFixed(2);\n        }\n\n        function dessinerScene() {\n            var canvas = document.getElementById(\"canvas\");\n            var ctx = canvas.getContext(\"2d\");\n\n            \/\/ R\u00e9initialiser le canvas\n            ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n            \/\/ Dessiner le sol\n            ctx.beginPath();\n            ctx.moveTo(0, 150);\n            ctx.lineTo(400, 150);\n            ctx.stroke();\n\n            \/\/ Dessiner la lunette astronomique\n            ctx.beginPath();\n            ctx.rect(50, 130, 30, 20);\n            ctx.stroke();\n\n            \/\/ Ligne vers l'\u00e9toile polaire\n            ctx.beginPath();\n            ctx.moveTo(65, 140);\n            ctx.lineTo(200, 20);\n            ctx.stroke();\n\n            \/\/ Dessiner l'\u00e9toile polaire\n            ctx.beginPath();\n            ctx.arc(200, 20, 5, 0, 2 * Math.PI);\n            ctx.fill();\n\n            \/\/ Mention de l'angle\n            ctx.font = \"12px Arial\";\n            ctx.fillText(\"Angle: \" + latitude.toFixed(2) + \"\u00b0\", 100, 110);\n        }\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Calculateur d&#8217;Angle pour Lunette Astronomique Obtenir Coordonn&eacute;es Angle d&#8217;inclinaison: degr&eacute;s<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":369,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"page-basique-the-tall-guy","meta":{"footnotes":""},"class_list":["post-372","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":17,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/372\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/372\/revisions\/649"}],"up":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/369"}],"wp:attachment":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/media?parent=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}