public Point3[] AxesCoordinates()
        {
            Point3[] pts = new Point3[4];

            // Create coordinate axes:
            pts[0] = new Point3(2 * side, -side, -side, 1);
            pts[1] = new Point3(-side, 2 * side, -side, 1);
            pts[2] = new Point3(-side, -side, 2 * side, 1);
            pts[3] = new Point3(-side, -side, -side, 1);

            return pts;
        }
Beispiel #2
0
 public Point3 Spherical(float r, float theta, float phi)
 {
     Point3 pt = new Point3();
     float snt = (float)Math.Sin(theta * Math.PI / 180);
     float cnt = (float)Math.Cos(theta * Math.PI / 180);
     float snp = (float)Math.Sin(phi * Math.PI / 180);
     float cnp = (float)Math.Cos(phi * Math.PI / 180);
     pt.X = r * snt * cnp;
     pt.Y = r * cnt;
     pt.Z = -r * snt * snp;
     pt.W = 1;
     return pt;
 }
Beispiel #3
0
 public Point3 Cylindrical(float r, float theta, float y)
 {
     Point3 pt = new Point3();
     float sn = (float)Math.Sin(theta * Math.PI / 180);
     float cn = (float)Math.Cos(theta * Math.PI / 180);
     pt.X = r * cn;
     pt.Y = y;
     pt.Z = -r * sn;
     pt.W = 1;
     return pt;
 }
Beispiel #4
0
        public Point3[] BoxCoordinates()
        {
            Point3[] pts = new Point3[8];

            // Create the Box:
            pts[0] = new Point3(side, -side, -side, 1);
            pts[1] = new Point3(side, side, -side, 1);
            pts[2] = new Point3(-side, side, -side, 1);
            pts[3] = new Point3(-side, -side, -side, 1);
            pts[4] = new Point3(-side, -side, side, 1);
            pts[5] = new Point3(side, -side, side, 1);
            pts[6] = new Point3(side, side, side, 1);
            pts[7] = new Point3(-side, side, side, 1);

            return pts;
        }