[BAEL-3348] Moved code to algorithm-4

This commit is contained in:
dupirefr
2019-11-01 00:35:30 +01:00
parent db85c8f275
commit fee1da6091
20514 changed files with 1642355 additions and 0 deletions
@@ -0,0 +1,21 @@
package com.baeldung.maths;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.jupiter.api.Test;
public class MathSinUnitTest {
@Test
public void givenAnAngleInDegrees_whenUsingToRadians_thenResultIsInRadians() {
double angleInDegrees = 30;
double sinForDegrees = Math.sin(Math.toRadians(angleInDegrees)); // 0.5
double thirtyDegreesInRadians = (double) 1 / 6 * Math.PI;
double sinForRadians = Math.sin(thirtyDegreesInRadians); // 0.5
assertThat(sinForDegrees, is(sinForRadians));
}
}