### Question:
DefaultEllipsoid extends AbstractShape3D implements Ellipsoid { @Override public Vector3d modelToLocal(Vector3d position) { return getInverseTransform().mult(position.subtract(myCenter)); } DefaultEllipsoid();  DefaultEllipsoid(double radius, double radius2, double radius3);  DefaultEllipsoid(Vector3d center, double radius, double radius2, double radius3);  DefaultEllipsoid(Vector3d center, Vector3d xAxis, Vector3d yAxis, Vector3d zAxis); @Override Vector3d directionToLocal(Vector3d direction); @Override Vector3d directionToModel(Vector3d direction); @Override double getBoundingRadius(); @Override Vector3d getCenter(); @Override double getHeading(Vector3d location, Vector3d direction); @Override Vector3d getIntersection(Ray3d ray); @Override long getSizeBytes(); @Override Vector3d getTangent(Vector3d normal); @Override Vector3d getXAxis(); @Override Vector3d getYAxis(); @Override Vector3d getZAxis(); @Override boolean isSphere(); @Override Vector3d localToModel(Vector3d position); @Override Vector3d modelToLocal(Vector3d position); @Override Vector3d normalToLocal(Vector3d normal); @Override String toString();  }### Answer:
@Test public void testModelToLocal() { Vector3d center = new Vector3d(3., 4., 13.); Vector3d xAxis = new Vector3d(7., 0., 0.); Vector3d yAxis = new Vector3d(0., 11., 0.); Vector3d zAxis = new Vector3d(0., 0., 13.); Ellipsoid ell = new DefaultEllipsoid(center, xAxis, yAxis, zAxis); Assert.assertEquals(new Vector3d(2., 3., 5.), ell.modelToLocal(new Vector3d(17., 37., 78.))); }
@Test public void testTransformToUnitSphere() { Vector3d center = new Vector3d(3., 0., 0.); Vector3d xAxis = new Vector3d(2., 1., 0.); Vector3d yAxis = new Vector3d(-1., 2., 0.); Vector3d zAxis = Vector3d.UNIT_Z; Ellipsoid ell = new DefaultEllipsoid(center, xAxis, yAxis, zAxis); Vector3d realX = Vector3d.UNIT_X; assertEquals(realX, ell.modelToLocal(xAxis.add(center))); }
@Test public void testTransformToUnitSphere2() { double xyRadius = 200; double zRadius = 20; Vector3d center = new Vector3d(3., 4., 13.); Vector3d loc1Direction = new Vector3d(200, 150, 45).getNormalized(); Vector3d loc2Direction = new Vector3d(-200, 100, 25).getNormalized(); Vector3d loc1 = loc1Direction.multiply(xyRadius).add(center); Vector3d loc2 = loc2Direction.multiply(xyRadius).add(center); Ellipsoid ell = createEllipsoid(xyRadius, zRadius, center, loc1, loc2); Vector3d realX = Vector3d.UNIT_X; assertEquals(realX, ell.modelToLocal(loc1)); assertTrue(MathUtil.isZero(ell.modelToLocal(loc2).getLength() - 1.)); }