I have a method that basically passes in a known drawn line segment in my view and then draws parallel lines n distances away from the passed in original line. This one in particular draws two parallel lines on either side.
It seems to be a lot of repeat code here, so how can I refactor it to a smaller method and avoid redundancy?
public List<Line> DrawTwoParallelLines(Line line)
{
List<Line> listOfParallelLines = new List<Line>();
Line parallelLine1 = new Line();
Line parallelLine2 = new Line();
Line parallelLine3 = new Line();
Line parallelLine4 = new Line();
parallelLine1.point1.x =(float)(line.point1.x + 50 * Math.Cos(90));
parallelLine1.point1.y = (float)(line.point1.y + 0 * Math.Cos(90));
parallelLine1.point2.x = (float)(line.point2.x + 50 * Math.Cos(90));
parallelLine1.point2.y = (float)(line.point2.y + 0 * Math.Cos(90));
parallelLine2.point1.x = (float)(line.point1.x + 100 * Math.Cos(90));
parallelLine2.point1.y = (float)(line.point1.y + 0 * Math.Cos(90));
parallelLine2.point2.x = (float)(line.point2.x + 100 * Math.Cos(90));
parallelLine2.point2.y = (float)(line.point2.y + 0 * Math.Cos(90));
parallelLine3.point1.x = (float)(line.point1.x + -50 * Math.Cos(90));
parallelLine3.point1.y = (float)(line.point1.y + 0 * Math.Cos(90));
parallelLine3.point2.x = (float)(line.point2.x + -50 * Math.Cos(90));
parallelLine3.point2.y = (float)(line.point2.y + 0 * Math.Cos(90));
parallelLine4.point1.x = (float)(line.point1.x + -100 * Math.Cos(90));
parallelLine4.point1.y = (float)(line.point1.y + 0 * Math.Cos(90));
parallelLine4.point2.x = (float)(line.point2.x + -100 * Math.Cos(90));
parallelLine4.point2.y = (float)(line.point2.y + 0 * Math.Cos(90));
listOfParallelLines.Add(parallelLine1);
listOfParallelLines.Add(parallelLine2);
listOfParallelLines.Add(parallelLine3);
listOfParallelLines.Add(parallelLine4);
return listOfParallelLines;
}