mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
[FEAT] Add Thin Lens formula for ray optics (#7170)
* [FEAT] Add Thin Lens formula for ray optics * [CI] Re-run clang-format checks * [CI] Re-run checks after rebase * [STYLE] Apply clang-format to ThinLensTest --------- Co-authored-by: Koushik Sai <nyamathabadkoushik@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b76962d5ad
commit
4f293b33e5
19
src/test/java/com/thealgorithms/physics/ThinLensTest.java
Normal file
19
src/test/java/com/thealgorithms/physics/ThinLensTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.thealgorithms.physics;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class ThinLensTest {
|
||||
|
||||
@Test
|
||||
void testConvexLensRealImage() {
|
||||
double v = ThinLens.imageDistance(10, 20);
|
||||
assertEquals(20, v, 1e-6);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMagnification() {
|
||||
assertEquals(2.0, ThinLens.magnification(20, 10), 1e-6);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user