public Point <TAlgebraicNumber> Translate(Direction <TAlgebraicNumber> direction, TAlgebraicNumber length) { var normalizedDirection = direction.Normalize(); return(new Point <TAlgebraicNumber>( _calculator, _calculator.Add(X, _calculator.Multiply(normalizedDirection.X, length)), _calculator.Add(Y, _calculator.Multiply(normalizedDirection.Y, length)))); }
public TAlgebraicNumber Determinant(Direction <TAlgebraicNumber> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } var a = _calculator.Multiply(X, other.Y); var b = _calculator.Multiply(Y, other.X); return(_calculator.Subtract(a, b)); }