sorry for my layman terminology, but to my understanding as a coder a function has a name, parameters, arguments and operations. if sin is the name, and its parameters are side opposite and hypotenuse, and its arguments are context dependent, what is the operation itself? am i making sense?
def sin (hypotenuse, opposite):
??!?!?!!?
Oddly enough, on a computer, I’ve have not seen secant, cosecant, or cotangent.
I have seen sin, cos, tan, arcsin, arccos, and arctan.
Though the arc functions will only have one parameter, so if this is homework, you’ll probably be avoiding the arcs and using secant and friends
Anyways:
sin ( angle )
sin(Math.PI / 4)
then I would be passing the argumentπ / 4
to the function./
,*
, and+
. Things that have multiple inputs and a single output, all of the same form.If someone is asking you, "which operation should you use in the body of function
sin ( hyponetuse, opposite )
then I imagine the expected answer would be,/
because/
is an operation, and becauseopposite / hypotenuse
will perform the division that yields the sine of whatever triangle those two sides belong to.