// Copyright 2015 The Chromium Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import'package:newton/newton.dart';classClampedSimulationextendsSimulation{ClampedSimulation(this.simulation,{this.xMin:double.NEGATIVE_INFINITY,this.xMax:double.INFINITY,this.dxMin:double.NEGATIVE_INFINITY,this.dxMax:double.INFINITY}){assert(simulation!=null);assert(xMax>=xMin);assert(dxMax>=dxMin);}finalSimulationsimulation;finaldoublexMin;finaldoublexMax;finaldoubledxMin;finaldoubledxMax;doublex(doubletime)=>simulation.x(time).clamp(xMin,xMax);doubledx(doubletime)=>simulation.dx(time).clamp(dxMin,dxMax);boolisDone(doubletime)=>simulation.isDone(time);}