Is is important to you to put some picture in coding. When you done long coding and left it for long time. Some time you forgot the structure and what that coding is all about. This picture will help you.

Sample coding below shows some rectangular picture in coding.


 // No.1 ---------------------- No.2
 //      |                    |
 //      |        o No.4      |
 //      |                    |
 // No.0 ---------------------- No.3
 //

public class Rectangular
 {

 // initial point taken from coordinate No. 0

    public double[] CalcRecCoor0(double width, double length, double InitialX, double InitialY)
    {
        double X0 = InitialX;
        double Y0 = InitialY;
        double X1 = InitialX;
        double Y1 = InitialY + length;
        double X2 = InitialX + width;
        double Y2 = InitialY + length;
        double X3 = InitialX + width;
        double Y3 = InitialY;

        double[] Position0 = new double[8] { X0, Y0, X1, Y1, X2, Y2, X3, Y3 };

        return Position0;

     }
  }

Leave a Reply