function result = PolynomialOrthogonalProjection(polynomial1,polynomial2)

% computes orthogonal projection of polynomial1 onto line spanned by polynomial2

result = polynomial2 * (PolynomialDotProduct(polynomial2,polynomial1,[-1, 1]) / PolynomialDotProduct(polynomial2,polynomial2,[-1, 1]));

end