# NormalDistribution class Null safety

Normal distribution (also known as Gaussian distribution).

# Example

``````import 'package:calc/calc.dart';

void main() {
final distribution = NormalDistribution(mean: 2.0, variance:1.0);

// Print 100 samples
final samples = distribution.sampleList(100);
print(samples);
}
``````
Inheritance

## Constructors

NormalDistribution({required double mean, required double variance})
Constructs a normal distribution with the given mean and variance.
NormalDistribution.fit( iterable)
Fits normal distribution to the scalars. [...]
factory

## Properties

hashCode int
The hash code for this object. [...]
mean
Mean of the distribution.
final
runtimeType Type
A representation of the runtime type of the object.
standardDeviation
Standard deviation.
variance
Variance of the distribution.
final

## Methods

cdf()
Cumulative Distribution Function (CDF). [...]
override
map<R>(R f(double value)) Distribution<R>
Maps samples of the distribution with the given function. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
pdf()
Probability Density Function (PDF).
override
probabilityForRange(double min, double max)
Calculates probability that the value is in the range.
inherited
sample({ random})
Generates a random sample. [...]
override
sampleList(int length, { random}) List<double>
Generates a list of N random samples. [...]
inherited
slice({double min = double.negativeInfinity, double max = double.infinity, int? attempts})
Returns a slice of the distribution. [...]
inherited
toString()
A string representation of this object. [...]
override

## Operators

operator ==(Object other) bool
The equality operator. [...]
override

## Static Methods

fitTensors( iterable)
Constructs a distribution for the tensors. [...]