У меня есть программа, которая позволяет пользователям рисовать кривые. Но эти кривые не выглядят красиво - они выглядят шатко и нарисованы вручную.
Итак, мне нужен алгоритм, который автоматически сгладит их. Я знаю, что в процессе сглаживания есть неотъемлемые неоднозначности, поэтому он не будет совершенным каждый раз, но такие алгоритмы, кажется, существуют в нескольких пакетах чертежей, и они работают достаточно хорошо.
Есть ли примеры кода для чего-то подобного? С# был бы идеальным, но я могу переводить с других языков.