Closed diluculo closed 6 years ago
@cdrnet please, take a look at this
In the meantime, I found another minor bug:
cos(a) * sin(b)
should be sin(a+b)/2 - sin(a-b)/2
@diluculo Where did you find this formula?
@FoggyFinder Angle addition formulas say
(1) sin(a+b) = sin(a)cos(b) + cos(a)sin(b)
(2) sin(a-b) = sin(a)cos(b) - cos(a)sin(b)
(1) - (2) gives sin(a+b) - sin(a-b) = 2cos(a)sin(b)
So, we can get cos(a)sin(b)= (sin(a+b) - sin(a-b))/2
Please see this
@diluculo oh, right - it seems like I mixed it up with sin(x)*cos(y)
Do you want add some test?
Some tests for Trigonometric.contract
are added
Great, thanks a lot for the fix and the additional tests!
PR for #41