by krastanov · 4y ago · 0 comments
The "coordination" is that they both use the "symbol" sin to refer to the idea of sine function.
Earlier in this thread though "symbol" was used in a less formal, handwavy way as "a named handle to some concept in the language". In that sense, indeed, the way that Julia adds multiple methods to a single named function and supports multiple dispatch permits amazing interoperability (and has little to do with Julia/Lisp/Ruby symbol datastructures).
instance VectorSpace d => Floating (Dual d) where
pi = D pi zero
exp (D u u') = D (exp u) (scale (exp u) u')
log (D u u') = D (log u) (scale (log u) u')
--->sin (D u u') = D (sin u) (scale (cos u) u')
cos (D u u') = D (cos u) (scale (-sin u) u')
sinh (D u u') = D (sinh u) (scale (cosh u) u')
cosh (D u u') = D (cosh u) (scale (sinh u) u')
and the `sin` function on the right-hand side comes from `Float`, since `Float` is the type of the argument `u` in `sin u` in `D (sin u) (scale (cos u) u')`.cos(a+b) == cos(a)cos(b) - sin(a)sin(b)
then it works.
Something must be known in advance about the relationship between sin and cos for addition, otherwise you cannot go from one to the other (and the basic
cos(a)^2+sin(a)^2=1
is not enough for that.