counting / maths /geometry /sin_degrees.py
spagestic's picture
feat: enhance Gradio interfaces for trigonometric functions with detailed descriptions and examples
d29336a
raw
history blame contribute delete
458 Bytes
import math
import gradio as gr
def sin_degrees(angle):
"""Calculate the sine of an angle in degrees."""
return math.sin(math.radians(angle))
sin_degrees_interface = gr.Interface(
fn=sin_degrees,
inputs=gr.Number(label="Angle (degrees)"),
outputs="number",
title="Sine Calculator",
description="Calculate the sine of an angle in degrees. Enter an angle (e.g., 30) to get its sine value.",
examples=[[0], [30], [45], [90]]
)