Group Warmup
Background
Pythagorean theorem
SML
Math.sqrt(x)
Java
Math.sqrt(x)
Code To Implement
Java
class: |
SumDistancesToOrigin.java |
![Java.png](/cse425s/images/thumb/2/26/Java.png/32px-Java.png) |
methods: |
sumDistancesToOrigin |
package: |
distance.warmup |
source folder: |
src/main/java |
Math.sqrt(v)
public static double sumDistancesToOrigin(ImList<ImTuple2<Double, Double>> xys)
SML
file: |
src/main/sml/warmup_sum_distances_to_origin/sum_distances_to_origin.sml |
![Smlnj-logo.png](/cse425s/images/thumb/a/ad/Smlnj-logo.png/32px-Smlnj-logo.png) |
functions: |
sum_distances_to_origin |
Math.sqrt(v)
fun sum_distances_to_origin(xys)
Test
Java
class: |
SumDistancesToOriginTestSuite.java |
![Junit.png](/cse425s/images/thumb/6/64/Junit.png/48px-Junit.png) |
package: |
distance.warmup |
source folder: |
src/test/java |
SML
file: |
unit_test_sum_distances_to_origin.sml |
|
source folder: |
src/test/sml/warmup_sum_distances_to_origin |