Skip to content

Instantly share code, notes, and snippets.

View christerswahn's full-sized avatar

Christer Eliasi-Swahn christerswahn

View GitHub Profile
@christerswahn
christerswahn / TrajectoryCalculator.java
Created May 16, 2012 08:36
Computes the optimal trajectory from A to B in a solar system using classical mechanics.
/**
* Authored 2012 by Christer Swahn
*/
import nu.chervil.util.math.SpatialTuple;
import nu.chervil.util.math.SpatialVector;
import org.apache.log4j.Logger;
/**
@christerswahn
christerswahn / SampleSet.java
Created June 1, 2012 18:37
A small set of classes that enable efficient collection of data samples and provides statistical measures on them.
/** A container that collects a set of data samples and provides statistical measures on them.
* <P>
* The general contract is that the methods shall not return any other value than 0
* in case no samples' have been inserted into the set.
* Implementing classes may choose to throw IllegalStateException in such an illegal use case.
* <P>
* Implementing classes are not generally required to be thread-safe.
*/
public interface SampleSet {
/** Puts a sample into this bucket sample counter.