Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/(core)/physics/ForceRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export class ForceRenderer {

let labelText = text;
if (showMag && magnitude !== undefined) {
labelText = `${text} (${magnitude.toFixed(1)}N)`;
const unit = options.unit ?? "N";
labelText = `${text} (${magnitude.toFixed(1)}${unit})`;
}

p.push();
Expand Down
3 changes: 2 additions & 1 deletion simulations/BallAcceleration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export default function BallAcceleration() {
accelerationForce.x / bodyRef.current.params.mass,
-(accelerationForce.y / bodyRef.current.params.mass),
"#ef4444",
"Acceleration"
"Acceleration",
{ unit: "m/sΒ²" }
);
}

Expand Down
2 changes: 1 addition & 1 deletion simulations/BallGravity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default function BallGravity() {
kineticEnergy: bodyRef.current.getKineticEnergy(),
potentialEnergy: bodyRef.current.getPotentialEnergy(
gravity,
toMeters(p.height)
size / 2
),
},
{
Expand Down
Loading