/// <summary> /// Moves the symbol to origin by subtracting arithmetic mean from every point /// </summary> private void MoveToOrigin() { double tcX = MathHandler.ArithmeticMean(_xPositions); double tcY = MathHandler.ArithmeticMean(_yPositions); for (int i = 0; i < _size; i++) { _xPositions[i] -= tcX; _yPositions[i] -= tcY; } }
/// <summary> /// Scales the points to fit interval -1 to 1 /// </summary> private void ScalePoints() { double mX = MathHandler.AbsMax(_xPositions); double mY = MathHandler.AbsMax(_yPositions); double m = Math.Max(mX, mY); for (var i = 0; i < _size; i++) { _xPositions[i] /= m; _yPositions[i] /= m; } }