Commit 316def4
authored
Add Snell's Law refraction algorithm (#7150)
* Add Snell's Law implementation for refraction angle
* Add tests for Snell's Law calculations
* Update documentation with reference link to Snell's Law
Added a reference link to Snell's Law in the documentation.
* Prevent instantiation of SnellLaw class
Make SnellLaw class non-instantiable by adding a private constructor.
* Rename SnellsLawTest to SnellLawTest
* Refactor SnellLawTest for clarity and accuracy
* Rename SnellsLaw.java to SnellLaw.java
* Refactor SnellLawTest with additional assertions
* Refactor SnellLaw class constructor and error handling
Refactor SnellLaw constructor and error message formatting.
* Fix missing newline at end of SnellLawTest.java
Ensure that the SnellLawTest class has a newline at the end of the file.
* Simplify assertions in SnellLawTest
* Simplify exception throwing for total internal reflection1 parent 246162e commit 316def4
File tree
2 files changed
+74
-0
lines changed- src
- main/java/com/thealgorithms/physics
- test/java/com/thealgorithms/physics
2 files changed
+74
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments