Skip to content

Commit

Permalink
Cleanup is tons of fun
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicScrewdriver committed Oct 4, 2024
1 parent fe0bef1 commit 5f748f1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/perseus/src/widgets/interactive-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,7 @@ class InteractiveGraph extends React.Component<Props, State> {
throw makeInvalidTypeError("getAngleEquationString", "angle");
}
const coords = InteractiveGraph.getAngleCoords(props.graph, props);
const allowReflexAngles = props.graph.allowReflexAngles || false;
const allowReflexAngles = props.graph.allowReflexAngles;
const angle = getClockwiseAngle(coords, allowReflexAngles);
return (
angle.toFixed(0) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ describe("shouldDrawArcOutside", () => {
const point2 = [2, 0] as vec.Vector2;
const vertex = [0, 0] as vec.Vector2;
const coords: [Coord, Coord, Coord] = [point1, vertex, point2];
const allowReflexAngles = false;
expect(getClockwiseAngle(coords, allowReflexAngles)).toBe(45);
expect(getClockwiseAngle(coords)).toBe(45);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function interactiveGraphValidator(
) {
const guess = userInput.coords;
const correct = rubric.correct.coords;
const allowReflexAngles = rubric.correct.allowReflexAngles || false;
const allowReflexAngles = rubric.correct.allowReflexAngles;

let match;
if (rubric.correct.match === "congruent") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const getAngleFromVertex = (
// current angle for the interactive graph.
export const getClockwiseAngle = (
coords: [Coord, Coord, Coord],
allowReflexAngles: boolean,
allowReflexAngles: boolean = false,
): number => {
const coordsCopy = [...coords];
// The coords are saved as [point1, vertex, point2] in the interactive graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,7 @@ describe("movePoint on an angle graph", () => {
invariant(updated.type === "angle");

expect(
getClockwiseAngle(
updated.coords,
updated.allowReflexAngles || false,
),
getClockwiseAngle(updated.coords, updated.allowReflexAngles),
).toBeCloseTo(50);
});

Expand Down

0 comments on commit 5f748f1

Please sign in to comment.