// Numbas version: exam_results_page_options {"name": "Equation of line perpendicular to given line, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-1,1)", "description": "", "name": "s1"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(d1..11)", "description": "", "name": "b"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+Random(1..4)*s1", "description": "", "name": "c"}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b-d)/(a-c)", "description": "", "name": "f"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d+1", "description": "", "name": "d1"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "gcd(b-d,c-a)", "description": "", "name": "n1"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)*random(1..4)", "description": "", "name": "a"}, "k": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "k"}, "h": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "h"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "d"}, "g": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b*c-a*d)/(c-a)", "description": "", "name": "g"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(b*c=a*d,1,gcd(n1,b*c-a*d))", "description": "", "name": "n2"}}, "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "h", "s1", "n1", "n2", "k", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Equation of line perpendicular to given line, ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"stepsPenalty": 1, "scripts": {}, "gaps": [{"answer": "({a-c}/{d-b})x+{c*h-a*h+d*k-b*k}/{d-b}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

Input all numbers as fractions or integers as appropriate and not as decimals.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 2, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$y=\\;\\phantom{{}}$[[0]]

", "steps": [{"type": "information", "prompt": "\n

The equation of the line is of the form $y=mx+c$.

\n

The gradient $m$ will be the $\\dfrac{-1}{n}$ where $n$ is the gradient of the line $\\displaystyle \\simplify{{(b-d)/n2}x+{(c-a)/n2}y={(b*c-a*d)/n2}}$, so start by calculating the gradient of the second line. Having calculated $n$, calculate $m=\\dfrac{-1}{n}$ and finally calculate the constant term $c$ by noting that $y=\\var{k}$ when $x=\\var{h}$.

\n ", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}], "statement": "\n

Find the equation of the straight line which:

\n \n

 

\n \n

 

\n

Input your answer in the form $mx+c$ for suitable values of $m$ and $c$.

\n

Input $m$ and $c$ as fractions or integers as appropriate and not as decimals.

\n

If you input $m$ as a fraction, put brackets ( ) around the fraction. For example, if your answer for $m$ is $\\dfrac{-2}{3}$ and your answer for $c$ is $\\dfrac{7}{5}$, you should write $(-2/3)x+7/5$.

\n

Click on Show steps if you need help, you will lose 1 mark if you do so.

\n \n ", "tags": ["MAS1602", "SFY0001", "checked2015", "equation of a straight line", "gradient of a line", "perpendicular line"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find the equation of the straight line perpendicular to the given line that passes through the given point $(a,b)$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n

The equation of the line is of the form $y=mx+c$.

\n

The gradient $m$ will be the $\\dfrac{-1}{n}$ where $n$ is the gradient of the line $\\displaystyle \\simplify{{(b-d)/n2}x+{(c-a)/n2}y={(b*c-a*d)/n2}}$, which is $\\displaystyle n= \\simplify{{b-d}/{a-c}}$. Having calculated $n$, calculate $\\displaystyle m=\\dfrac{-1}{n} = \\simplify{{a-c}/{d-b}}$. We can calculate the constant term $c$ by noting that $y=\\var{k}$ when $x=\\var{h}$.

\n

Using this we get:
\\[ \\begin{eqnarray} \\var{k}&=&\\simplify[std]{({a-c}/{d-b}){h}+c} \\Rightarrow\\\\ c&=&\\simplify[std]{{k}-({a-c}/{d-b}){h}={c*h-a*h+d*k-b*k}/{d-b}} \\end{eqnarray} \\]

\n

Hence the equation of the line is
\\[y = \\simplify[std]{({a-c}/{d-b})x+{c*h-a*h+d*k-b*k}/{d-b}}\\]

\n ", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}