Skip to content

Instantly share code, notes, and snippets.

@ctrueden
Created March 21, 2012 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctrueden/2144264 to your computer and use it in GitHub Desktop.
Save ctrueden/2144264 to your computer and use it in GitHub Desktop.
RealPoint constructors
/**
* Protected constructor that can re-use the passed position array.
*
* @param position
* array used to store the position.
* @param copy
* flag indicating whether to make a copy of the array.
*/
protected RealPoint( final double[] position, final boolean copy )
{
super( copy ? position.clone() : position );
}
/**
* Create a point at a definite location in a space of the dimensionality of
* the position.
*
* @param position
* the initial position. The length of the array determines the
* dimensionality of the space.
*/
public RealPoint( final double... position )
{
this( position, true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment