@Test public void safetyZoneXYAreTranslatedForwardX() { Ellipse ellipse = sut.safetyZone(position, position, 90.0f, 0.0f, 100.0f, 15.0f, 33, 6); assertEquals(42.0, ellipse.getX(), 1e-6); assertEquals(-1.5, ellipse.getY(), 1e-6); }
public Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard) { final double v = 1.0; final double l1 = max(safetyEllipseLength*v, 1.0 + safetyEllipseBehind*v*2.0); final double b1 = max(safetyEllipseBreadth*v, 1.5); final double xc = -safetyEllipseBehind*v + 0.5*l1; return createEllipse(geodeticReference, position, cog, loa, beam, dimStern, dimStarboard, l1, b1, xc); }
SafetyZoneService { public Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard) { final double v = 1.0; final double l1 = max(safetyEllipseLength*v, 1.0 + safetyEllipseBehind*v*2.0); final double b1 = max(safetyEllipseBreadth*v, 1.5); final double xc = -safetyEllipseBehind*v + 0.5*l1; return createEllipse(geodeticReference, position, cog, loa, beam, dimStern, dimStarboard, l1, b1, xc); } }
SafetyZoneService { public Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard) { final double v = 1.0; final double l1 = max(safetyEllipseLength*v, 1.0 + safetyEllipseBehind*v*2.0); final double b1 = max(safetyEllipseBreadth*v, 1.5); final double xc = -safetyEllipseBehind*v + 0.5*l1; return createEllipse(geodeticReference, position, cog, loa, beam, dimStern, dimStarboard, l1, b1, xc); } @Inject  SafetyZoneService(Configuration configuration); }
SafetyZoneService { public Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard) { final double v = 1.0; final double l1 = max(safetyEllipseLength*v, 1.0 + safetyEllipseBehind*v*2.0); final double b1 = max(safetyEllipseBreadth*v, 1.5); final double xc = -safetyEllipseBehind*v + 0.5*l1; return createEllipse(geodeticReference, position, cog, loa, beam, dimStern, dimStarboard, l1, b1, xc); } @Inject  SafetyZoneService(Configuration configuration); Ellipse vesselExtent(Position position, float hdg, float loa, float beam, float dimStern, float dimStarboard); Ellipse vesselExtent(Position geodeticReference, Position position, float hdg, float loa, float beam, float dimStern, float dimStarboard); Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard); }
SafetyZoneService { public Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard) { final double v = 1.0; final double l1 = max(safetyEllipseLength*v, 1.0 + safetyEllipseBehind*v*2.0); final double b1 = max(safetyEllipseBreadth*v, 1.5); final double xc = -safetyEllipseBehind*v + 0.5*l1; return createEllipse(geodeticReference, position, cog, loa, beam, dimStern, dimStarboard, l1, b1, xc); } @Inject  SafetyZoneService(Configuration configuration); Ellipse vesselExtent(Position position, float hdg, float loa, float beam, float dimStern, float dimStarboard); Ellipse vesselExtent(Position geodeticReference, Position position, float hdg, float loa, float beam, float dimStern, float dimStarboard); Ellipse safetyZone(Position geodeticReference, Position position, float cog, float sog, float loa, float beam, float dimStern, float dimStarboard);  }