calculate_moment_of_inertia
Calculate moment of inertia for various shapes using mass, dimensions, and rotation axis.
Instructions
Calculate moment of inertia for various shapes.
Moment of inertia (I) is the rotational equivalent of mass. It determines
how difficult it is to change an object's rotation. Depends on both mass
distribution and rotation axis.
Args:
shape: Shape type - "sphere", "solid_sphere", "hollow_sphere", "rod", "disk", "cylinder", "box"
mass: Mass in kilograms
radius: Radius for sphere/disk/cylinder (meters)
length: Length for rod (meters)
width: Width for box (meters)
height: Height for box/cylinder (meters)
depth: Depth for box (meters)
axis: Rotation axis - "center", "end" (for rod), "x", "y", "z" (for box)
Returns:
Dict containing:
- moment_of_inertia: I in kg⋅m²
- shape: Shape type
- axis: Rotation axis
Common formulas:
- Solid sphere (center): I = (2/5)mr²
- Hollow sphere (center): I = (2/3)mr²
- Rod (center): I = (1/12)mL²
- Rod (end): I = (1/3)mL²
- Disk (center): I = (1/2)mr²
Example - Spinning wheel:
result = await calculate_moment_of_inertia(
shape="disk",
mass=5.0, # 5kg wheel
radius=0.3 # 30cm radius
)
# I = 0.225 kg⋅m²
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shape | Yes | ||
| mass | Yes | ||
| radius | No | ||
| length | No | ||
| width | No | ||
| height | No | ||
| depth | No | ||
| axis | No | center |
Implementation Reference
- MCP tool endpoint decorated with @tool. Accepts shape, mass, radius, length, width, height, depth, axis as parameters and delegates to the core handler in ../rotational.py.
@tool # type: ignore[arg-type] async def calculate_moment_of_inertia( shape: str, mass: float, radius: Optional[float] = None, length: Optional[float] = None, width: Optional[float] = None, height: Optional[float] = None, depth: Optional[float] = None, axis: str = "center", ) -> dict: """Calculate moment of inertia for various shapes. Moment of inertia (I) is the rotational equivalent of mass. It determines how difficult it is to change an object's rotation. Depends on both mass distribution and rotation axis. Args: shape: Shape type - "sphere", "solid_sphere", "hollow_sphere", "rod", "disk", "cylinder", "box" mass: Mass in kilograms radius: Radius for sphere/disk/cylinder (meters) length: Length for rod (meters) width: Width for box (meters) height: Height for box/cylinder (meters) depth: Depth for box (meters) axis: Rotation axis - "center", "end" (for rod), "x", "y", "z" (for box) Returns: Dict containing: - moment_of_inertia: I in kg⋅m² - shape: Shape type - axis: Rotation axis Common formulas: - Solid sphere (center): I = (2/5)mr² - Hollow sphere (center): I = (2/3)mr² - Rod (center): I = (1/12)mL² - Rod (end): I = (1/3)mL² - Disk (center): I = (1/2)mr² Example - Spinning wheel: result = await calculate_moment_of_inertia( shape="disk", mass=5.0, # 5kg wheel radius=0.3 # 30cm radius ) # I = 0.225 kg⋅m² """ from ..rotational import MomentOfInertiaRequest, calculate_moment_of_inertia as calc_moi request = MomentOfInertiaRequest( shape=shape, # type: ignore mass=mass, radius=radius, length=length, width=width, height=height, depth=depth, axis=axis, ) response = calc_moi(request) return response.model_dump()