} // 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); }
public g3ColVec InterSect(g3Line second) { return(second.At((dir[1, 2, 1] * pnt[1, 1, 1] - dir[1, 1, 1] * pnt[1, 2, 1] + dir[1, 1, 1] * second.pnt[1, 2, 1] - dir[1, 2, 1] * second.pnt[1, 1, 1]) / (dir[1, 2, 1] * second.dir[1, 1, 1] - dir[1, 1, 1] * second.dir[1, 2, 1]))); }