public static Vector3D Transform(Vector3D v) { double angle = Math.PI / 3; // Kind of weird, and not really controllable. v.RotateAboutAxis(new Vector3D(1, 0), angle); Mobius m = new Mobius(); m.Isometry(Geometry.Hyperbolic, 0, new Complex(0, 0.5)); v = H3Models.TransformHelper(v, m); v.RotateAboutAxis(new Vector3D(1, 0), -angle); return(v); }
/// <summary> /// Face centered orientation. /// </summary> internal static void FCOrient(H3.Cell cell) { // First, need to scale so the lowest triangles are the same size, // then reorient so that one triangle is oriented along z axis, // then scale so that the triangle is flat. // Calculate how much we need to offset to make the cell facet flat. Mobius m = FCOrientMobius(cell.Facets[0].Sphere); foreach (H3.Cell.Facet f in cell.Facets) { H3Models.TransformInBall2(f.Sphere, m); } cell.Center = H3Models.TransformHelper(cell.Center, m); }