protected get deltaX(): number {
return this.xRange.getLength() / ( this.numberOfPoints - 1 );
}
Both of the quantities used to compute deltaX are constants, so deltaX is a constant. So it's preferrable to convert deltaX to protected readonly deltaX: number and compute it once in the constructor.
It's unlikely to make a noticable performance difference. But deltaX is used in loops, like this one in TransformedCurve smooth:
for ( let dx = this.deltaX; dx <= numberOfStandardDeviations * STANDARD_DEVIATION;
dx += this.deltaX ) {
In Curve.ts:
Both of the quantities used to compute deltaX are constants, so deltaX is a constant. So it's preferrable to convert deltaX to
protected readonly deltaX: number
and compute it once in the constructor.It's unlikely to make a noticable performance difference. But
deltaX
is used in loops, like this one in TransformedCurvesmooth
:@veillette any reason why I shouldn't do this?