C# Class LibNoise.NMath

Provides math operations not found in System.Math.
Afficher le fichier Open project: MadoxLabs/NoiseTool

Méthodes publiques

Свойство Type Description
DEG_TO_RAD double
PI double
RAD_TO_DEG double
Sqrt2 double
Sqrt3 double

Méthodes publiques

Méthode Description
ClampValue ( double value, double lowerBound, double upperBound ) : double
ClampValue ( int value, int lowerBound, int upperBound ) : int

Returns the given value clamped between the given lower and upper bounds. - @a value if @a value lies between @a lowerBound and @a upperBound. - @a lowerBound if @a value is less than @a lowerBound. - @a upperBound if @a value is greater than @a upperBound.

CubicInterpolate ( double n0, double n1, double n2, double n3, double a ) : double

Returns the cubic interpolation of two values bound between two other values.

GetLarger ( double a, double b ) : double

Returns the larger of the two given numbers.

GetSmaller ( double a, double b ) : double

Returns the smaller of the two given numbers.

GradientCoherentNoise ( double x, double y, double z, int seed, NoiseQuality noiseQuality ) : double
GradientNoise ( double fx, double fy, double fz, int ix, int iy, int iz, long seed ) : double
IntValueNoise ( int x, int y, int z, int seed ) : int
LatLonToXYZ ( double lat, double lon, double &x, double &y, double &z ) : void

Provides the X, Y, and Z coordinates on the surface of a sphere cooresponding to the given latitude and longitude.

LinearInterpolate ( double n0, double n1, double a ) : double

Returns the linear interpolation of two values with the given alpha.

MakeInt32Range ( double n ) : double

Returns the given value, modified to be able to fit into a 32-bit integer.

SCurve3 ( double a ) : double

Returns the given value mapped onto a cubic S-curve. @a a should range from 0.0 to 1.0. The derivitive of a cubic S-curve is zero at @a a = 0.0 and @a a = 1.0

SCurve5 ( double a ) : double

Returns the given value mapped onto a quintic S-curve. @a a should range from 0.0 to 1.0. The first derivitive of a quintic S-curve is zero at @a a = 0.0 and @a a = 1.0 The second derivitive of a quintic S-curve is zero at @a a = 0.0 and @a a = 1.0

SwapValues ( double &a, double &b ) : void

Swaps the values contained by the two given variables.

ValueCoherentNoise ( double x, double y, double z, int seed, NoiseQuality noiseQuality ) : double
ValueNoise ( int x, int y, int z ) : double
ValueNoise ( int x, int y, int z, int seed ) : double

Method Details

ClampValue() public static méthode

public static ClampValue ( double value, double lowerBound, double upperBound ) : double
value double
lowerBound double
upperBound double
Résultat double

ClampValue() public static méthode

Returns the given value clamped between the given lower and upper bounds. - @a value if @a value lies between @a lowerBound and @a upperBound. - @a lowerBound if @a value is less than @a lowerBound. - @a upperBound if @a value is greater than @a upperBound.
public static ClampValue ( int value, int lowerBound, int upperBound ) : int
value int
lowerBound int
upperBound int
Résultat int

CubicInterpolate() public static méthode

Returns the cubic interpolation of two values bound between two other values.
public static CubicInterpolate ( double n0, double n1, double n2, double n3, double a ) : double
n0 double The value before the first value.
n1 double The first value.
n2 double The second value.
n3 double The value after the second value.
a double The alpha value.
Résultat double

GetLarger() public static méthode

Returns the larger of the two given numbers.
public static GetLarger ( double a, double b ) : double
a double
b double
Résultat double

GetSmaller() public static méthode

Returns the smaller of the two given numbers.
public static GetSmaller ( double a, double b ) : double
a double
b double
Résultat double

GradientCoherentNoise() public static méthode

public static GradientCoherentNoise ( double x, double y, double z, int seed, NoiseQuality noiseQuality ) : double
x double
y double
z double
seed int
noiseQuality NoiseQuality
Résultat double

GradientNoise() public static méthode

public static GradientNoise ( double fx, double fy, double fz, int ix, int iy, int iz, long seed ) : double
fx double
fy double
fz double
ix int
iy int
iz int
seed long
Résultat double

IntValueNoise() public static méthode

public static IntValueNoise ( int x, int y, int z, int seed ) : int
x int
y int
z int
seed int
Résultat int

LatLonToXYZ() public static méthode

Provides the X, Y, and Z coordinates on the surface of a sphere cooresponding to the given latitude and longitude.
public static LatLonToXYZ ( double lat, double lon, double &x, double &y, double &z ) : void
lat double
lon double
x double
y double
z double
Résultat void

LinearInterpolate() public static méthode

Returns the linear interpolation of two values with the given alpha.
public static LinearInterpolate ( double n0, double n1, double a ) : double
n0 double
n1 double
a double
Résultat double

MakeInt32Range() public static méthode

Returns the given value, modified to be able to fit into a 32-bit integer.
public static MakeInt32Range ( double n ) : double
n double
Résultat double

SCurve3() public static méthode

Returns the given value mapped onto a cubic S-curve. @a a should range from 0.0 to 1.0. The derivitive of a cubic S-curve is zero at @a a = 0.0 and @a a = 1.0
public static SCurve3 ( double a ) : double
a double
Résultat double

SCurve5() public static méthode

Returns the given value mapped onto a quintic S-curve. @a a should range from 0.0 to 1.0. The first derivitive of a quintic S-curve is zero at @a a = 0.0 and @a a = 1.0 The second derivitive of a quintic S-curve is zero at @a a = 0.0 and @a a = 1.0
public static SCurve5 ( double a ) : double
a double
Résultat double

SwapValues() public static méthode

Swaps the values contained by the two given variables.
public static SwapValues ( double &a, double &b ) : void
a double
b double
Résultat void

ValueCoherentNoise() public static méthode

public static ValueCoherentNoise ( double x, double y, double z, int seed, NoiseQuality noiseQuality ) : double
x double
y double
z double
seed int
noiseQuality NoiseQuality
Résultat double

ValueNoise() public static méthode

public static ValueNoise ( int x, int y, int z ) : double
x int
y int
z int
Résultat double

ValueNoise() public static méthode

public static ValueNoise ( int x, int y, int z, int seed ) : double
x int
y int
z int
seed int
Résultat double

Property Details

DEG_TO_RAD public_oe static_oe property

public static double DEG_TO_RAD
Résultat double

PI public_oe static_oe property

public static double PI
Résultat double

RAD_TO_DEG public_oe static_oe property

public static double RAD_TO_DEG
Résultat double

Sqrt2 public_oe static_oe property

public static double Sqrt2
Résultat double

Sqrt3 public_oe static_oe property

public static double Sqrt3
Résultat double