public static void CalcSphere() { double r = Model.TypeChecker.WriteAndReadDoubleLine("Ange radien i cm: "); Model.Shape sphere = new Model.Sphere(r); Console.WriteLine(sphere); Model.Json.Save(sphere, "View/json/sphere.json"); }
//Methods// public void Build(IModule sourceModule) { Model.Sphere sphereModel = new Model.Sphere(sourceModule); double lonExtent = EastLonBound - WestLonBound; double latExtent = NorthLatBound - SouthLatBound; double xDelta = lonExtent / (double)Map.Width; double yDelta = latExtent / (double)Map.Height; double curLon = WestLonBound; double curLat = SouthLatBound; for (int y = 0; y < Map.Height; y++) { curLon = WestLonBound; for (int x = 0; x < Map.Width; x++) { float curValue = (float)sphereModel.GetValue(curLat, curLon); Map.SetValue(x, y, curValue); curLon += xDelta; } curLat += yDelta; } }