Measure types are erased (see the specification), so you effectively have two definitions of cos(angle: float)
which causes the error.
You could create a union type for the two possibilities
type Angle = Degrees of float | Radians of float
or give the functions different names.