import React, { useState } from 'react';
import { Calculator, Activity, Zap, AlertCircle } from 'lucide-react';
const MovementDynamicsCalculator = () => {
const [bodyWeight, setBodyWeight] = useState('');
const [jumpHeight, setJumpHeight] = useState('');
const [contactTime, setContactTime] = useState('');
const [results, setResults] = useState(null);
const calculateGRF = () => {
if (!bodyWeight || !jumpHeight || !contactTime) {
alert('Please fill in all fields');
return;
}
const weight = parseFloat(bodyWeight);
const height = parseFloat(jumpHeight) / 100; // convert cm to meters
const time = parseFloat(contactTime) / 1000; // convert ms to seconds
// Calculate impact velocity using v = sqrt(2gh)
const impactVelocity = Math.sqrt(2 * 9.81 * height);
// Calculate deceleration during landing
const deceleration = impactVelocity / time;
// Calculate Ground Reaction Force
// GRF = Body Weight + (Mass × Deceleration)
const mass = weight / 9.81;
const additionalForce = mass * deceleration;
const totalGRF = weight + additionalForce;
// Calculate force multiple (how many times body weight)
const forceMultiple = totalGRF / weight;
// Calculate impulse (Force × Time)
const impulse = totalGRF * time;
// Risk assessment
let riskLevel = 'Low';
let riskColor = 'text-green-600';
if (forceMultiple > 3) {
riskLevel = 'Moderate';
riskColor = 'text-yellow-600';
}
if (forceMultiple > 5) {
riskLevel = 'High';
riskColor = 'text-red-600';
}
setResults({
impactVelocity: impactVelocity.toFixed(2),
deceleration: deceleration.toFixed(1),
totalGRF: totalGRF.toFixed(1),
forceMultiple: forceMultiple.toFixed(1),
impulse: impulse.toFixed(1),
riskLevel,
riskColor
});
};
const clearResults = () => {
setBodyWeight('');
setJumpHeight('');
setContactTime('');
setResults(null);
};
return (
);
};
Movement Dynamics Calculator
Calculate Ground Reaction Force during landing/jumping
{/* Input Section */}
{/* Results Section */}
Input Parameters
setBodyWeight(e.target.value)}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="e.g., 700"
/>
Weight in Newtons (kg × 9.81)
setJumpHeight(e.target.value)}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="e.g., 40"
/>
Vertical jump height in centimeters
setContactTime(e.target.value)}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="e.g., 250"
/>
Time in contact with ground (milliseconds)
{results && (
)}
{/* Information Panel */}
Results
Impact Velocity
{results.impactVelocity} m/s
Deceleration
{results.deceleration} m/s²
Ground Reaction Force
{results.totalGRF} N
{results.forceMultiple}× body weight
Impulse
{results.impulse} N⋅s
Risk Assessment
{results.riskLevel}
Based on force multiple
Formula Used
Impact Velocity: v = √(2gh)
Deceleration: a = v/t
GRF: F = Weight + (Mass × Deceleration)
Impulse: J = F × t
Risk Guidelines:
- • Low: <3× body weight
- • Moderate: 3-5× body weight
- • High: >5× body weight