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