## org.apache.commons.math.analysis.interpolation
Class MicrosphereInterpolator

    java.lang.Object
      org.apache.commons.math.analysis.interpolation.MicrosphereInterpolator

All Implemented Interfaces:
  MultivariateRealInterpolator

    public class MicrosphereInterpolator

extends java.lang.Object
implements MultivariateRealInterpolator

Interpolator that implements the algorithm described in William Dudziak's MS thesis

Since:
  2.1
Version:
  $Revision: 924794 $ $Date: 2010-03-18 10:15:50 -0400 (Thu, 18 Mar 2010) $

Field Summary
`private int` `brightnessExponent` Exponent used in the power law that computes the weights of the sample data.
`static int` `DEFAULT_BRIGHTNESS_EXPONENT` Default exponent used the weights calculation.
`static int` `DEFAULT_MICROSPHERE_ELEMENTS` Default number of surface elements that composes the microsphere.
`private int` `microsphereElements` Number of surface elements of the microsphere.

Constructor Summary
`MicrosphereInterpolator()` Create a microsphere interpolator with default settings.
`MicrosphereInterpolator(int microsphereElements, int brightnessExponent)` Create a microsphere interpolator.

Method Summary
`MultivariateRealFunction` `interpolate(double[][] xval, double[] yval)` Computes an interpolating function for the data set.
`void` `setBrightnessExponent(int brightnessExponent)` Set the brightness exponent.
`void` `setMicropshereElements(int elements)` Set the number of microsphere elements.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_MICROSPHERE_ELEMENTS

    public static final int DEFAULT_MICROSPHERE_ELEMENTS

  Default number of surface elements that composes the microsphere.

  See Also:
    Constant Field Values

### DEFAULT_BRIGHTNESS_EXPONENT

    public static final int DEFAULT_BRIGHTNESS_EXPONENT

  Default exponent used the weights calculation.

  See Also:
    Constant Field Values

### microsphereElements

    private int microsphereElements

  Number of surface elements of the microsphere.

### brightnessExponent

    private int brightnessExponent

  Exponent used in the power law that computes the weights of the sample data.

Constructor Detail

### MicrosphereInterpolator

    public MicrosphereInterpolator()

  Create a microsphere interpolator with default settings.

  Calling this constructor is equivalent to call `MicrosphereInterpolator(MicrosphereInterpolator.DEFAULT_MICROSPHERE_ELEMENTS, MicrosphereInterpolator.DEFAULT_BRIGHTNESS_EXPONENT)`.

  weights of the sample data

### MicrosphereInterpolator

    public MicrosphereInterpolator(int microsphereElements,
                                   int brightnessExponent)

  Create a microsphere interpolator.

  Parameters:
    `microsphereElements` - number of surface elements of the microsphere
    `brightnessExponent` - exponent used in the power law that computes the weights of the sample data
  Throws:
    `java.lang.IllegalArgumentException` - if `microsphereElements <= 0` or `brightnessExponent < 0`

Method Detail

### interpolate

    public MultivariateRealFunction interpolate(double[][] xval,
                                                double[] yval)
                                         throws MathException,
                                                java.lang.IllegalArgumentException

  Computes an interpolating function for the data set.

  Specified by:
    `interpolate` in interface `MultivariateRealInterpolator`
  Parameters:
    `xval` - the arguments for the interpolation points. `xval[i][0]` is the first component of interpolation point `i`, `xval[i][1]` is the second component, and so on until `xval[i][d-1]`, the last component of that interpolation point (where `d` is thus the dimension of the space).
    `yval` - the values for the interpolation points
  Returns:
    a function which interpolates the data set
  Throws:
    `MathException` - if arguments violate assumptions made by the interpolation algorithm or some dimension mismatch occurs
    `java.lang.IllegalArgumentException` - if there are no data (xval null or zero length)

### setBrightnessExponent

    public void setBrightnessExponent(int brightnessExponent)

  Set the brightness exponent.

  Parameters:
    `brightnessExponent` - Exponent for computing the distance dimming factor.
  Throws:
    `java.lang.IllegalArgumentException` - if `brightnessExponent < 0`.

### setMicropshereElements

    public void setMicropshereElements(int elements)

  Set the number of microsphere elements.

  Parameters:
    `elements` - Number of surface elements of the microsphere.
  Throws:
    `java.lang.IllegalArgumentException` - if `microsphereElements <= 0`.

Copyright (c) 2003-2011 Apache Software Foundation