Пример #1
0
        public g3ColVec At(double len)
        {
            g3ColVec ret = new g3ColVec(0, 0, 0);

            ret[1, 1, 1] = pnt[1, 1, 1] + dir[1, 1, 1] * len;
            ret[1, 2, 1] = pnt[1, 2, 1] + dir[1, 2, 1] * len;
            ret[1, 3, 1] = pnt[1, 3, 1] + dir[1, 3, 1] * len;
            return(ret);
        }
Пример #2
0
        }                                                                                          // must be moved to g2Line, only for testing, all z-Values must be 0 for testing

        private static void selfTest()
        {
            selfTested = true;
            g3Line g = new g3Line(new g3RowVec(0, 0, 0), new g3RowVec(1, 1, 0));

            ass(g.At((Math.Sqrt(2))).x == 1);
            ass(g.At((Math.Sqrt(2))).y == 1);

            g3Line   h = new g3Line(new g3RowVec(0, 2, 0), new g3RowVec(2, 0, 0));
            g3ColVec s = h.InterSect(g);

            ass(s[1, 1, 1] == 1);
            ass(s[1, 2, 1] == 1);
            ass(s[1, 3, 1] == 0);
            ass(h.yAt(2) == 0);
            ass(h.xAt(1) == 1);
            ass(h.parallel(Math.Sqrt(2) / 2).yAt(3) == 0);
        }
Пример #3
0
 public g3ColVec(g3ColVec cloneFrom) : base(3, 1, 1)
 {
     this.x = cloneFrom.x; this.y = cloneFrom.y; this.z = cloneFrom.z;
 }