calculate_normal_force
Compute normal force on an incline using mass, angle, and optional additional force. Returns normal force and weight components parallel and perpendicular to the surface.
Instructions
Calculate normal force on an inclined plane.
On an incline at angle θ:
- N = mg cos(θ) + F_additional
- Weight component perpendicular: mg cos(θ)
- Weight component parallel: mg sin(θ)
Args:
mass: Object mass in kg
gravity: Gravitational acceleration in m/s² (default 9.81)
angle_degrees: Incline angle in degrees (0 = horizontal)
additional_force: Additional perpendicular force in Newtons (optional)
Returns:
Dict containing:
- normal_force: Normal force in Newtons
- weight_component_perpendicular: Weight component ⊥ to surface
- weight_component_parallel: Weight component ∥ to surface
Example - Box on 30° ramp:
result = await calculate_normal_force(
mass=10.0,
angle_degrees=30.0
)
# normal_force ≈ 84.9 NInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mass | Yes | ||
| gravity | No | ||
| angle_degrees | No | ||
| additional_force | No |
Implementation Reference
- MCP tool handler function for calculate_normal_force. This is the @tool-decorated async function that is the public MCP interface. It accepts mass, gravity, angle_degrees, and optional additional_force, creates a NormalForceRequest, delegates to the core implementation in ..statics, and returns a dict via model_dump().
@tool # type: ignore[arg-type] async def calculate_normal_force( mass: float, gravity: float = 9.81, angle_degrees: float = 0.0, additional_force: float | None = None, ) -> dict: """Calculate normal force on an inclined plane. On an incline at angle θ: - N = mg cos(θ) + F_additional - Weight component perpendicular: mg cos(θ) - Weight component parallel: mg sin(θ) Args: mass: Object mass in kg gravity: Gravitational acceleration in m/s² (default 9.81) angle_degrees: Incline angle in degrees (0 = horizontal) additional_force: Additional perpendicular force in Newtons (optional) Returns: Dict containing: - normal_force: Normal force in Newtons - weight_component_perpendicular: Weight component ⊥ to surface - weight_component_parallel: Weight component ∥ to surface Example - Box on 30° ramp: result = await calculate_normal_force( mass=10.0, angle_degrees=30.0 ) # normal_force ≈ 84.9 N """ from ..statics import NormalForceRequest from ..statics import calculate_normal_force as calc_normal request = NormalForceRequest( mass=mass, gravity=gravity, angle_degrees=angle_degrees, additional_force=additional_force, ) response = calc_normal(request) return response.model_dump() - NormalForceRequest Pydantic model - input schema defining mass (float >0), gravity (default 9.81), angle_degrees (0-90), and optional additional_force.
class NormalForceRequest(BaseModel): """Request for normal force calculation.""" mass: float = Field(..., description="Object mass in kg", gt=0.0) gravity: float = Field(default=9.81, description="Gravitational acceleration in m/s²", gt=0.0) angle_degrees: float = Field( default=0.0, description="Incline angle in degrees (0 = horizontal)", ge=0.0, le=90.0 ) additional_force: Optional[float] = Field( None, description="Additional perpendicular force in Newtons (optional)" ) - NormalForceResponse Pydantic model - output schema with normal_force, weight_component_perpendicular, and weight_component_parallel (all floats in Newtons).
class NormalForceResponse(BaseModel): """Response for normal force calculation.""" normal_force: float = Field(..., description="Normal force in Newtons") weight_component_perpendicular: float = Field( ..., description="Weight component perpendicular to surface in Newtons" ) weight_component_parallel: float = Field( ..., description="Weight component parallel to surface in Newtons" ) - Core implementation function. Takes a NormalForceRequest, calculates weight = mass*gravity, converts angle to radians, computes perpendicular (mg cosθ) and parallel (mg sinθ) components, adds optional additional_force, returns NormalForceResponse.
def calculate_normal_force(request: NormalForceRequest) -> NormalForceResponse: """Calculate normal force on an inclined plane. On an incline at angle θ: - N = mg cos(θ) + F_additional - Weight component perpendicular: mg cos(θ) - Weight component parallel: mg sin(θ) Args: request: Normal force request Returns: Normal force and weight components """ weight = request.mass * request.gravity angle_rad = math.radians(request.angle_degrees) weight_perpendicular = weight * math.cos(angle_rad) weight_parallel = weight * math.sin(angle_rad) normal_force = weight_perpendicular if request.additional_force is not None: normal_force += request.additional_force return NormalForceResponse( normal_force=normal_force, weight_component_perpendicular=weight_perpendicular, weight_component_parallel=weight_parallel, ) - src/chuk_mcp_physics/tools/statics.py:5-5 (registration)Tool registration via the @tool decorator (from chuk_mcp_server) applied to the calculate_normal_force async function at line 165.
from chuk_mcp_server import tool