Calculate point line buffer c#