public static Xyf Create(int x, int y, int f) { Xyf temp = new Xyf(); temp.ix = x; temp.iy = y; temp.face = f; return(temp); }
private void SetCorners() { Xyf xyf = Xyf.Create(tileX, tileY, face); double dc = 0.5 / nside; double xc = (xyf.ix + 0.5) / nside; double yc = (xyf.iy + 0.5) / nside; TopLeft = Fxyf.Create(xc + dc, yc + dc, xyf.face).toVec3(); BottomLeft = Fxyf.Create(xc - dc, yc + dc, xyf.face).toVec3(); BottomRight = Fxyf.Create(xc - dc, yc - dc, xyf.face).toVec3(); TopRight = Fxyf.Create(xc + dc, yc - dc, xyf.face).toVec3(); }
private Vector3d[] Boundaries(int x, int y, int step) { int nside = step * Math.Pow(2, Level); Vector3d[] points = new Vector3d[4]; Xyf xyf = Xyf.Create(x + faceX * step, y + faceY * step, face); double dc = 0.5 / nside; double xc = (xyf.ix + 0.5) / nside; double yc = (xyf.iy + 0.5) / nside; points[0] = Fxyf.Create(xc + dc, yc + dc, xyf.face).toVec3(); points[1] = Fxyf.Create(xc - dc, yc + dc, xyf.face).toVec3(); points[2] = Fxyf.Create(xc - dc, yc - dc, xyf.face).toVec3(); points[3] = Fxyf.Create(xc + dc, yc - dc, xyf.face).toVec3(); return(points); }