--- kf_03-19T15-06-15-227478.py +++ kf_03-19T15-50-07-090361.py @@ -495,6 +495,14 @@ math.cos(hour_angle_rad)) sin_elevation = max(-1.0, min(1.0, sin_elevation)) return math.degrees(math.asin(sin_elevation)) +def vertical_shadow_length(height: Distance, solar_elevation_deg: float) -> Distance: + if not isinstance(height, Distance): + raise TypeError("height must be a Distance instance.") + if solar_elevation_deg <= 0: + raise ValueError("solar_elevation_deg must be positive.") + height_m = height.value.convert_to(meter_unit).number + shadow_m = height_m / math.tan(math.radians(float(solar_elevation_deg))) + return Distance(Value(shadow_m, meter_unit)) hockey_puck = PhysicalObject( name=Name('hockey_puck'), mass=Mass(Value(0.170, kilogram_unit)), @@ -507,3 +515,11 @@ name=Name("hot_wheels_car"), mass=Mass(Value(0.035, kilogram_unit)), ) +bic_crystal_pen = PhysicalObject( + name=Name('bic_crystal_pen'), + mass=Mass(Value(0.050, kilogram_unit)), + shape=Cylinder( + radius=Radius(Value(0.45, centimeter_unit)), + height=Distance(Value(14.9, centimeter_unit)), + ), +)