-
- {simulationPaused && mode != "Tutorial" && (
-
- {
- setSimulationPaused(false);
- }}
- >
-
-
-
+
+ {simulationPaused && (
+
)}
- {!simulationPaused && mode != "Tutorial" && (
-
- {
- setSimulationPaused(true);
- }}
- >
-
-
-
+ {!simulationPaused && (
+
)}
- {simulationPaused && mode != "Tutorial" && (
-
- {
- setSimulationReset(!simulationReset);
- }}
- >
-
-
-
+ {simulationPaused && (
+
)}
-
+
- {mode == "Review" && (
-
- {!hintDialogueOpen && (
-
{
- setHintDialogueOpen(true);
- }}
- sx={{
- position: "fixed",
- left: xMax - 50 + "px",
- top: yMin + 14 + "px",
- }}
- >
-
-
- )}
-
-
-
-
{questionPartOne}
-
{questionPartTwo}
-
-
{answerInputFields}
-
-
- )}
- {mode == "Tutorial" && (
-
-
-
Problem
-
{selectedTutorial.question}
-
-
-
{
- let step = stepNumber - 1;
- step = Math.max(step, 0);
- step = Math.min(step, selectedTutorial.steps.length - 1);
- setStepNumber(step);
- setStartForces(
- getForceFromJSON(selectedTutorial.steps[step].forces)
- );
- setUpdatedForces(
- getForceFromJSON(selectedTutorial.steps[step].forces)
- );
- setShowForceMagnitudes(
- selectedTutorial.steps[step].showMagnitude
- );
- }}
- disabled={stepNumber == 0}
- >
-
-
-
-
- Step {stepNumber + 1}:{" "}
- {selectedTutorial.steps[stepNumber].description}
-
-
{selectedTutorial.steps[stepNumber].content}
-
-
{
- let step = stepNumber + 1;
- step = Math.max(step, 0);
- step = Math.min(step, selectedTutorial.steps.length - 1);
- setStepNumber(step);
- setStartForces(
- getForceFromJSON(selectedTutorial.steps[step].forces)
- );
- setUpdatedForces(
- getForceFromJSON(selectedTutorial.steps[step].forces)
- );
- setShowForceMagnitudes(
- selectedTutorial.steps[step].showMagnitude
- );
- }}
- disabled={stepNumber == selectedTutorial.steps.length - 1}
- >
-
-
-
-
-
Resources
- {simulationType == "One Weight" && (
-
- )}
- {simulationType == "Inclined Plane" && (
-
- )}
- {simulationType == "Pendulum" && (
-
- )}
-
-
- )}
- {mode == "Review" && (
-
-
setMode("Tutorial")}
- >
- {" "}
- Go to walkthrough{" "}
-
-
-
-
-
-
- )}
-
- {mode == "Freeform" && (
-
-
-
- {!wedge && !pendulum && (
-
- setElasticCollisions(!elasticCollisions)
- }
- />
- }
- label="Make collisions elastic"
- labelPlacement="start"
- />
- )}
- {!wedge && !pendulum && }
- setShowForces(!showForces)}
- defaultChecked
- />
- }
- label="Show force vectors"
- labelPlacement="start"
- />
- setShowAcceleration(!showAcceleration)}
- />
- }
- label="Show acceleration vector"
- labelPlacement="start"
- />
- setShowVelocity(!showVelocity)}
- />
- }
- label="Show velocity vector"
- labelPlacement="start"
- />
-
-
- {wedge && simulationPaused && (
-
-
- θ
- Angle of incline plane from the ground, 0-49
-
- }
- followCursor
- >
- θ
-
- }
- lowerBound={0}
- changeValue={setWedgeAngle}
- step={1}
- unit={"°"}
- upperBound={49}
- value={wedgeAngle}
- effect={changeWedgeBasedOnNewAngle}
- radianEquivalent={true}
- mode={"Freeform"}
- />
-
-
- μs
-
- Coefficient of static friction, between 0 and 1
-
- }
- followCursor
- >
-
- μs
-
-
- }
- lowerBound={0}
- changeValue={setCoefficientOfStaticFriction}
- step={0.1}
- unit={""}
- upperBound={1}
- value={coefficientOfStaticFriction}
- effect={updateForcesWithFriction}
- mode={"Freeform"}
- />
-
-
- μk
-
- Coefficient of kinetic friction, between 0 and
- coefficient of static friction
-
- }
- followCursor
- >
-
- μk
-
-
- }
- lowerBound={0}
- changeValue={setCoefficientOfKineticFriction}
- step={0.1}
- unit={""}
- upperBound={Number(coefficientOfStaticFriction)}
- value={coefficientOfKineticFriction}
- mode={"Freeform"}
- />
-
- )}
- {wedge && !simulationPaused && (
-
- θ: {Math.round(Number(wedgeAngle) * 100) / 100}° ≈{" "}
- {Math.round(((Number(wedgeAngle) * Math.PI) / 180) * 100) /
- 100}{" "}
- rad
-
- μ s: {coefficientOfStaticFriction}
-
- μ k: {coefficientOfKineticFriction}
-
- )}
- {pendulum && !simulationPaused && (
-
- θ: {Math.round(pendulumAngle * 100) / 100}° ≈{" "}
- {Math.round(((pendulumAngle * Math.PI) / 180) * 100) / 100}{" "}
- rad
-
- )}
- {pendulum && simulationPaused && (
-
-
- θ
- Pendulum angle offest from equilibrium
-
- }
- followCursor
- >
- θ
-
- }
- lowerBound={0}
- changeValue={setPendulumAngle}
- step={1}
- unit={"°"}
- upperBound={59}
- value={pendulumAngle}
- effect={(value) => {
- if (pendulum) {
- const mag =
- 1 * 9.81 * Math.cos((value * Math.PI) / 180);
-
- const forceOfTension: IForce = {
- description: "Tension",
- magnitude: mag,
- directionInDegrees: 90 - value,
- };
- setUpdatedForces([forceOfGravity, forceOfTension]);
- setAdjustPendulumAngle({
- angle: value,
- length: pendulumLength,
- });
- }
- }}
- radianEquivalent={true}
- mode={"Freeform"}
- />
-
- Length
- Pendulum rod length
-
- }
- followCursor
- >
- Length
-
- }
- lowerBound={0}
- changeValue={setPendulumLength}
- step={1}
- unit={"m"}
- upperBound={400}
- value={pendulumLength}
- effect={(value) => {
- if (pendulum) {
- setAdjustPendulumAngle({
- angle: pendulumAngle,
- length: value,
- });
- }
- }}
- radianEquivalent={false}
- mode={"Freeform"}
- />
-
- )}
-
- )}
-
- {mode == "Freeform" && twoWeights &&
Red Weight
}
- {mode == "Freeform" && weight && (
-
-
-
- |
- X |
- Y |
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
- Position
- Equation: x1
- =x
- 0
- +v
- 0
- t+0.5at
- 2
-
- Units: m
-
- }
- followCursor
- >
- Position
-
- |
-
- {(!simulationPaused || wedge) && (
-
- {positionXDisplay} m
-
- )}{" "}
- {simulationPaused && !wedge && (
- {
- setDisplayChange({
- xDisplay: value,
- yDisplay: positionYDisplay,
- });
- }}
- small={true}
- mode={"Freeform"}
- />
- )}{" "}
- |
-
- {(!simulationPaused || wedge) && (
-
- {positionYDisplay} m
-
- )}{" "}
- {simulationPaused && !wedge && (
- {
- setDisplayChange({
- xDisplay: positionXDisplay,
- yDisplay: value,
- });
- }}
- small={true}
- mode={"Freeform"}
- />
- )}{" "}
- |
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
- Velocity
- Equation: v1
- =v
- 0
- +at
-
- Units: m/s
-
- }
- followCursor
- >
- Velocity
-
- |
-
- {(!simulationPaused || pendulum || wedge) && (
-
- {velocityXDisplay} m/s
-
- )}{" "}
- {simulationPaused && !pendulum && !wedge && (
-
- setDisplayChange({
- xDisplay: positionXDisplay,
- yDisplay: positionYDisplay,
- })
- }
- small={true}
- mode={"Freeform"}
- />
- )}{" "}
- |
-
- {(!simulationPaused || pendulum || wedge) && (
-
- {velocityYDisplay} m/s
-
- )}{" "}
- {simulationPaused && !pendulum && !wedge && (
-
- setDisplayChange({
- xDisplay: positionXDisplay,
- yDisplay: positionYDisplay,
- })
- }
- small={true}
- mode={"Freeform"}
- />
- )}{" "}
- |
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
-
- Acceleration
-
- Equation: a=F/m
-
- Units: m/s
- 2
-
- }
- followCursor
- >
- Acceleration
-
- |
-
- {accelerationXDisplay} m/s2
- |
-
- {accelerationYDisplay} m/s2
- |
-
-
-
- )}
-
{/* {mode == "Freeform" &&
simulationElements.length > 0 &&
simulationElements[0].pendulum && (
@@ -2146,7 +831,7 @@ function App() {
)}*/}