{"id":154,"date":"2020-01-17T22:54:34","date_gmt":"2020-01-17T22:54:34","guid":{"rendered":"https:\/\/henriksenmatematik.wordpress.com\/?p=154"},"modified":"2026-04-09T22:42:38","modified_gmt":"2026-04-09T20:42:38","slug":"ortogonale-linjer-2","status":"publish","type":"post","link":"https:\/\/mxth.dk\/?p=154","title":{"rendered":"Ortogonale Linjer"},"content":{"rendered":"\n<p>Vi vil her se p\u00e5 hvordan vi kan tjekke om to linjer er vinkelrette p\u00e5 hinanden, det vi i matematikken kalder for <strong>ortogonale linjer<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-embed alignfull is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/SegatEcggJg?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=da-DK&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n\n\n\n<style>\n* {font-family:\"Helvetica\", Helvetica, Helvetica}\nbody{\n    font-size: 14px;\n    font-family: sans-serif;\n    color: #333;\n}\n.question{\n    font-weight: 600;\n}\n.answers {\n  margin-bottom: 20px;\n}\n.answers label{\n  display: block;\n}\n\n.text-center{text-align: center}\n\n#submit{\n    font-family: sans-serif;\n    font-size: 20px;\n    background-color: #279;\n    color: #fff;\n    border: 0px;\n    border-radius: 3px;\n    padding: 20px;\n    cursor: pointer;\n    margin-bottom: 20px;\n   text-align: center;\n}\n#submit:hover{\n    background-color: #38a;\n}\n<\/style>\n\n<meta charset=\"utf-8\">\n\n\n\n\n\n<div id=\"quiz\"><\/div>\n<div class=\"text-center\"><button id=\"submit\">Submit Quiz<\/button><\/div>\n<div id=\"results\"><\/div>\n\n<script type=\"text\/javascript\" src=\"http:\/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">\n<\/script>\n\n<script>\n(function() {\n  function buildQuiz() {\n    \/\/ we'll need a place to store the HTML output\n    const output = [];\n\n    \/\/ for each question...\n    myQuestions.forEach((currentQuestion, questionNumber) => {\n      \/\/ we'll want to store the list of answer choices\n      const answers = [];\n\n      \/\/ and for each available answer...\n      for (letter in currentQuestion.answers) {\n        \/\/ ...add an HTML radio button\n        answers.push(\n          `<label>\n            <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n            ${letter} :\n            ${currentQuestion.answers[letter]}\n          <\/label>`\n        );\n      }\n\n      \/\/ add this question and its answers to the output\n      output.push(\n        `<div class=\"question\"> ${currentQuestion.question} <\/div>\n        <div class=\"answers\"> ${answers.join(\"\")} <\/div>`\n      );\n    });\n\n    \/\/ finally combine our output list into one string of HTML and put it on the page\n    quizContainer.innerHTML = output.join(\"\");\n  }\n\n  function showResults() {\n    \/\/ gather answer containers from our quiz\n    const answerContainers = quizContainer.querySelectorAll(\".answers\");\n\n    \/\/ keep track of user's answers\n    let numCorrect = 0;\n\n    \/\/ for each question...\n    myQuestions.forEach((currentQuestion, questionNumber) => {\n      \/\/ find selected answer\n      const answerContainer = answerContainers[questionNumber];\n      const selector = `input[name=question${questionNumber}]:checked`;\n      const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n\n      \/\/ if answer is correct\n      if (userAnswer === currentQuestion.correctAnswer) {\n        \/\/ add to the number of correct answers\n        numCorrect++;\n\n        \/\/ color the answers green\n        answerContainers[questionNumber].style.color = \"lightgreen\";\n      } else {\n        \/\/ if answer is wrong or blank\n        \/\/ color the answers red\n        answerContainers[questionNumber].style.color = \"red\";\n      }\n    });\n\n    \/\/ show number of correct answers out of total\n    resultsContainer.innerHTML = `${numCorrect} out of ${myQuestions.length}`;\n  }\n\n  const quizContainer = document.getElementById(\"quiz\");\n  const resultsContainer = document.getElementById(\"results\");\n  const submitButton = document.getElementById(\"submit\");\n  const myQuestions = [\n    {\n      question: \"Hvilke af disse par af rette linjer er ortogonale p\u00e5 hinanden?\",\n      answers: {\n        a: \"<math><mi>y<\/mi><mo>=<\/mo><mo>-<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mi>x<\/mi><mo>+<\/mo><mn>2<\/mn><\/math> og <math><mi>y<\/mi><mo>=<\/mo><mn>2<\/mn><mi>x<\/mi><mo>-<\/mo><mn>4<\/mn><\/math>\",\n        b: \"<math><mi>y<\/mi><mo>=<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mi>x<\/mi><mo>-<\/mo><mn>2<\/mn><\/math> og <math><mi>y<\/mi><mo>=<\/mo><mn>2<\/mn><mi>x<\/mi><\/math>\",\n        c: \"<math><mi>y<\/mi><mo>=<\/mo><mo>-<\/mo><mi>x<\/mi><\/math> og <math><mi>y<\/mi><mo>=<\/mo><mo>-<\/mo><mi>x<\/mi><mo>-<\/mo><mn>4<\/mn><\/math>\"\n      },\n      correctAnswer: \"a\"\n    },\n    {\n      question: \"Hvorn\u00e5r er to linjer ortogonale p\u00e5 hinanden?\",\n      answers: {\n        a: \"N\u00e5r produktet af h\u00e6ldningerne er 0\",\n        b: \"N\u00e5r de har samme h\u00e6ldning\",\n        c: \"N\u00e5r produktet af h\u00e6ldningerne er -1\"\n      },\n      correctAnswer: \"c\"\n    },\n    {\n      question: \"Hvis en linje har en h\u00e6ldning p\u00e5 <math><mfrac><mn>3<\/mn><mn>4<\/mn><\/mfrac><\/math> hvad er s\u00e5 h\u00e6ldningen p\u00e5 den ortogonale linje?\",\n      answers: {\n        a: \"<math><mo>-<\/mo><mfrac><mn>3<\/mn><mn>4<\/mn><\/mfrac><\/math>\",\n        b: \"<math><mo>-<\/mo><mfrac><mn>4<\/mn><mn>3<\/mn><\/mfrac><\/math>\",\n        c: \"<math><mfrac><mn>4<\/mn><mn>3<\/mn><\/mfrac><\/math>\",\n        d: \"<math><mfrac><mn>3<\/mn><mn>4<\/mn><\/mfrac><\/math>\"\n      },\n      correctAnswer: \"b\"\n    }\n  ];\n\n  \/\/ display quiz right away\n  buildQuiz();\n\n  \/\/ on submit, show results\n  submitButton.addEventListener(\"click\", showResults);\n})();\n<\/script>\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Vi vil her se p\u00e5 hvordan vi kan tjekke om to linjer er vinkelrette p\u00e5 hinanden, det vi i matematikken kalder for ortogonale linjer. Submit Quiz<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","editor_plus_copied_stylings":"{}","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,3],"tags":[74],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-analytisk-plangeometri","category-matematik","tag-htx"],"featured_image_src":null,"author_info":{"display_name":"Henriksen","author_link":"https:\/\/mxth.dk\/?author=1"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mxth.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":1,"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":614,"href":"https:\/\/mxth.dk\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/614"}],"wp:attachment":[{"href":"https:\/\/mxth.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mxth.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mxth.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}