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