commit ff67737a89305a0c837cbdc855c299b15536a6a3
parent 53320a48b96366e56209262cb86ac2779f87a8ee
Author: fen123456 <fenwthompson@gmail.com>
Date: Thu, 13 Aug 2026 12:22:51 +0100
laying groundwork for double reflection
Diffstat:
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/src/components/questions/DoubleReflectionQuestion.jsx b/src/components/questions/DoubleReflectionQuestion.jsx
@@ -0,0 +1,41 @@
+import { getRandomChoice, getRandomInt } from "../../scripts/utils";
+import CoordinateLabel from "../graphing/CoordinateLabel";
+import Graph from "../graphing/Graph";
+import Question from "../Question";
+
+function shapeToString(shape) {
+ return shape.map((point) => point.join(",")).join(" ")
+}
+
+function reflectPoint(point, line = {a: 1, b: 1, c: 0}) {
+ const [px, py] = point
+ const k = (line.a*px + line.b*py + line.c) / (line.a**2 + line.b**2)
+ return [px - 2*line.a*k, py - 2*line.b*k]
+}
+
+function findIntersect(line1, line2) {
+ // this condition should work for both bs = 0 too.
+ if (line1.a/line1.b == line2.a/line2.b) {
+ return null
+ }
+ return ()
+}
+
+export default function DoubleReflectionQuestion({ seed, showAnswer }) {
+ const viewBox = [-7, -7, 14, 14]
+ const originalShape = [[0, 1], [2, 1], [0, 2]]
+
+ const linetypes = ['horizontal', 'vertical', 'diagonal']
+
+
+
+ const question = (<>
+ <p>
+ What single transformation..?
+ </p>
+ <Graph viewBox={viewBox} width="300" height="300">
+ </Graph>
+ </>)
+
+ return <Question question={question} answer="" showAnswer={showAnswer} />
+}
diff --git a/src/data/questions/gcse/double-transformations.js b/src/data/questions/gcse/double-transformations.js
@@ -1,4 +1,5 @@
import DoubleTransformationQuestion from "/src/components/questions/DoubleTransformationQuestion";
+import DoubleReflectionQuestion from "../../../components/questions/DoubleReflectionQuestion";
export const data = {
questionLists: [{
@@ -6,6 +7,9 @@ export const data = {
n: 3,
questions: [{
type: DoubleTransformationQuestion,
+ },
+ {
+ type: DoubleReflectionQuestion,
}]
}]
}