A method of determining apparent horizons in three-dimensional numerical relativity