### Question:
CursorPoint { public double getDistanceFromOrigin() { return Math.hypot(this.x, this.y); } CursorPoint(int x, int y, int delay); double getDistanceFromOrigin(); double getThetaFromOrigin(); CursorPoint getCursorPointTranslatedBy(CursorPoint startingCursorPoint); CursorPoint getCursorPointScaledBy(double scaleFactor); CursorPoint getCursorPointRotatedBy(double angleOfRotation); CursorPoint getCursorPointTransformedByParabola(double[] parabolaEquation); CursorPoint getCursorPointWithNewDelay(int delay); void display(); public int x; public int y; public int delay; }### Answer:
@Test void testDistanceFromOrigin() { CursorPoint a = new CursorPoint(0, 0, 0); CursorPoint b = new CursorPoint(3, 4, 0); CursorPoint c = new CursorPoint(500, 750, 0); CursorPoint d = new CursorPoint(284, 848, 0); assertEquals(0, a.getDistanceFromOrigin()); assertEquals(894.293016857, d.getDistanceFromOrigin(), 0.0001); assertEquals(5, b.getDistanceFromOrigin(), 0.0001); }