// Numbas version: finer_feedback_settings {"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": [{"tags": [], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0, "name": ""}], "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 ", "name": "Equation of line perpendicular to given line, ", "preamble": {"js": "", "css": ""}, "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 ", "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "h", "s1", "n1", "n2", "k", "d1"], "metadata": {"description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "extensions": [], "variable_groups": [], "parts": [{"steps": [{"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 ", "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true, "type": "information", "scripts": {}, "variableReplacements": []}], "prompt": "

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

", "variableReplacementStrategy": "originalfirst", "gaps": [{"expectedvariablenames": [], "answer": "({a-c}/{d-b})x+{c*h-a*h+d*k-b*k}/{d-b}", "vsetrangepoints": 5, "showpreview": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "answersimplification": "std", "notallowed": {"message": "

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

", "strings": ["."], "partialCredit": 0, "showStrings": false}, "checkingaccuracy": 0.001, "showCorrectAnswer": true, "type": "jme", "checkingtype": "absdiff", "marks": 2, "vsetrange": [0, 1], "checkvariablenames": false, "variableReplacements": []}], "marks": 0, "showCorrectAnswer": true, "type": "gapfill", "scripts": {}, "stepsPenalty": 1, "variableReplacements": []}], "showQuestionGroupNames": false, "type": "question", "functions": {}, "variables": {"n2": {"definition": "if(b*c=a*d,1,gcd(n1,b*c-a*d))", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "n2"}, "k": {"definition": "random(-9..9)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "k"}, "n1": {"definition": "gcd(b-d,c-a)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "n1"}, "d": {"definition": "random(-9..9)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "d"}, "s1": {"definition": "random(-1,1)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "s1"}, "d1": {"definition": "d+1", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "d1"}, "g": {"definition": "(b*c-a*d)/(c-a)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "g"}, "a": {"definition": "random(1,-1)*random(1..4)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "a"}, "c": {"definition": "a+Random(1..4)*s1", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "c"}, "b": {"definition": "random(d1..11)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "b"}, "h": {"definition": "random(-9..9)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "h"}, "f": {"definition": "(b-d)/(a-c)", "description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "f"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "contributors": [{"name": "steve kilgallon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/268/"}]}]}], "contributors": [{"name": "steve kilgallon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/268/"}]}