📝 Description
The Projectile Motion Calculator lacks bounds checking and input validation for the "Launch Speed (m/s)" field. The application currently accepts negative numerical inputs (e.g., -10 m/s), executes the trajectory calculation, and renders a graph. Because speed is a scalar magnitude, a negative launch speed is physically meaningless in this context and leads to erroneous, nonsensical outputs (e.g., calculating a Time of Flight, Hmax, and Range for an impossible state).
🔄 Steps to Reproduce
- Open the "Projectile Motion Calculator" from the playground/utilities grid.
- Locate the "Launch Speed (m/s)" input field.
- Enter a negative numerical value (e.g.,
-10).
- Enter a valid Launch Angle (e.g.,
45).
- Click the "Launch" button.
- See error: The calculation executes successfully, populating the TOF, Hmax, and Range pills, and rendering a trajectory graph, rather than throwing an input validation error.
🎯 Expected Behavior
The "Launch Speed (m/s)" input field must implement strict validation to reject values <= 0. If a user attempts to submit a negative value or zero, the application should prevent the calculation, prevent the graph animation, and display a clear UI error message (e.g., "Launch speed must be greater than 0").
❌ Actual Behavior / Error Logs
The component accepts negative input strings, coerces them into the physics calculation, and returns nonsensical mathematical outputs without alerting the user to the invalid physical state.
💻 Environment
- OS: Windows 11
- Browser: Chrome / Brave
- File Name: Projectile Motion Calculator Component / Validation Logic
📝 Description
The Projectile Motion Calculator lacks bounds checking and input validation for the "Launch Speed (m/s)" field. The application currently accepts negative numerical inputs (e.g.,
-10 m/s), executes the trajectory calculation, and renders a graph. Because speed is a scalar magnitude, a negative launch speed is physically meaningless in this context and leads to erroneous, nonsensical outputs (e.g., calculating a Time of Flight, Hmax, and Range for an impossible state).🔄 Steps to Reproduce
-10).45).🎯 Expected Behavior
The "Launch Speed (m/s)" input field must implement strict validation to reject values
<= 0. If a user attempts to submit a negative value or zero, the application should prevent the calculation, prevent the graph animation, and display a clear UI error message (e.g., "Launch speed must be greater than 0").❌ Actual Behavior / Error Logs
The component accepts negative input strings, coerces them into the physics calculation, and returns nonsensical mathematical outputs without alerting the user to the invalid physical state.
💻 Environment